pub trait ItemHandle: 'static + Send {
Show 34 methods
// Required methods
fn focus_handle(&self, cx: &WindowContext<'_>) -> FocusHandle;
fn subscribe_to_item_events(
&self,
cx: &mut WindowContext<'_>,
handler: Box<dyn Fn(&ItemEvent, &mut WindowContext<'_>) + Send>
) -> Subscription;
fn tab_tooltip_text(&self, cx: &AppContext) -> Option<SharedString>;
fn tab_description(
&self,
detail: usize,
cx: &AppContext
) -> Option<SharedString>;
fn tab_content(
&self,
detail: Option<usize>,
cx: &WindowContext<'_>
) -> AnyElement;
fn dragged_tab_content(
&self,
detail: Option<usize>,
cx: &WindowContext<'_>
) -> AnyElement;
fn project_path(&self, cx: &AppContext) -> Option<ProjectPath>;
fn project_entry_ids(
&self,
cx: &AppContext
) -> SmallVec<[ProjectEntryId; 3]>;
fn project_item_model_ids(&self, cx: &AppContext) -> SmallVec<[EntityId; 3]>;
fn for_each_project_item(
&self,
_: &AppContext,
_: &mut dyn FnMut(EntityId, &dyn Item)
);
fn is_singleton(&self, cx: &AppContext) -> bool;
fn boxed_clone(&self) -> Box<dyn ItemHandle>;
fn clone_on_split(
&self,
workspace_id: WorkspaceId,
cx: &mut WindowContext<'_>
) -> Option<Box<dyn ItemHandle>>;
fn added_to_pane(
&self,
workspace: &mut Workspace,
pane: View<Pane>,
cx: &mut ViewContext<'_, Workspace>
);
fn deactivated(&self, cx: &mut WindowContext<'_>);
fn workspace_deactivated(&self, cx: &mut WindowContext<'_>);
fn navigate(&self, data: Box<dyn Any>, cx: &mut WindowContext<'_>) -> bool;
fn item_id(&self) -> EntityId;
fn to_any(&self) -> AnyView;
fn is_dirty(&self, cx: &AppContext) -> bool;
fn has_conflict(&self, cx: &AppContext) -> bool;
fn can_save(&self, cx: &AppContext) -> bool;
fn save(
&self,
project: Model<Project>,
cx: &mut WindowContext<'_>
) -> Task<Result<()>>;
fn save_as(
&self,
project: Model<Project>,
abs_path: PathBuf,
cx: &mut WindowContext<'_>
) -> Task<Result<()>>;
fn reload(
&self,
project: Model<Project>,
cx: &mut WindowContext<'_>
) -> Task<Result<()>>;
fn act_as_type(&self, type_id: TypeId, cx: &AppContext) -> Option<AnyView>;
fn to_followable_item_handle(
&self,
cx: &AppContext
) -> Option<Box<dyn FollowableItemHandle>>;
fn on_release(
&self,
cx: &mut AppContext,
callback: Box<dyn FnOnce(&mut AppContext) + Send>
) -> Subscription;
fn to_searchable_item_handle(
&self,
cx: &AppContext
) -> Option<Box<dyn SearchableItemHandle>>;
fn breadcrumb_location(&self, cx: &AppContext) -> ToolbarItemLocation;
fn breadcrumbs(
&self,
theme: &Theme,
cx: &AppContext
) -> Option<Vec<BreadcrumbText>>;
fn serialized_item_kind(&self) -> Option<&'static str>;
fn show_toolbar(&self, cx: &AppContext) -> bool;
fn pixel_position_of_cursor(&self, cx: &AppContext) -> Option<Point<Pixels>>;
}
Performs copy-assignment from
source
.
Read more