Struct workspace2::Workspace

source ·
pub struct Workspace { /* private fields */ }

Implementations§

source§

impl Workspace

source

pub fn has_shown_notification_once<V: Notification>( &self, id: usize, cx: &ViewContext<'_, Self> ) -> bool

source

pub fn show_notification_once<V: Notification>( &mut self, id: usize, cx: &mut ViewContext<'_, Self>, build_notification: impl FnOnce(&mut ViewContext<'_, Self>) -> View<V> )

source

pub fn show_notification<V: Notification>( &mut self, id: usize, cx: &mut ViewContext<'_, Self>, build_notification: impl FnOnce(&mut ViewContext<'_, Self>) -> View<V> )

source

pub fn dismiss_notification<V: Notification>( &mut self, id: usize, cx: &mut ViewContext<'_, Self> )

source

pub fn show_toast(&mut self, toast: Toast, cx: &mut ViewContext<'_, Self>)

source

pub fn dismiss_toast(&mut self, id: usize, cx: &mut ViewContext<'_, Self>)

source§

impl Workspace

source

pub fn new( workspace_id: WorkspaceId, project: Model<Project>, app_state: Arc<AppState>, cx: &mut ViewContext<'_, Self> ) -> Self

source

pub fn weak_handle(&self) -> WeakView<Self>

source

pub fn left_dock(&self) -> &View<Dock>

source

pub fn bottom_dock(&self) -> &View<Dock>

source

pub fn right_dock(&self) -> &View<Dock>

source

pub fn add_panel<T: Panel>( &mut self, panel: View<T>, cx: &mut ViewContext<'_, Self> )

source

pub fn status_bar(&self) -> &View<StatusBar>

source

pub fn app_state(&self) -> &Arc<AppState>

source

pub fn user_store(&self) -> &Model<UserStore>

source

pub fn project(&self) -> &Model<Project>

source

pub fn recent_navigation_history( &self, limit: Option<usize>, cx: &AppContext ) -> Vec<(ProjectPath, Option<PathBuf>)>

source

pub fn go_back( &mut self, pane: WeakView<Pane>, cx: &mut ViewContext<'_, Workspace> ) -> Task<Result<()>>

source

pub fn go_forward( &mut self, pane: WeakView<Pane>, cx: &mut ViewContext<'_, Workspace> ) -> Task<Result<()>>

source

pub fn reopen_closed_item( &mut self, cx: &mut ViewContext<'_, Workspace> ) -> Task<Result<()>>

source

pub fn client(&self) -> &Client

source

pub fn set_titlebar_item( &mut self, item: AnyView, cx: &mut ViewContext<'_, Self> )

source

pub fn titlebar_item(&self) -> Option<AnyView>

source

pub fn with_local_workspace<T, F>( &mut self, cx: &mut ViewContext<'_, Self>, callback: F ) -> Task<Result<T>>where T: 'static, F: 'static + FnOnce(&mut Workspace, &mut ViewContext<'_, Workspace>) -> T,

Call the given callback with a workspace whose project is local.

If the given workspace has a local project, then it will be passed to the callback. Otherwise, a new empty window will be created.

source

pub fn worktrees<'a>( &self, cx: &'a AppContext ) -> impl 'a + Iterator<Item = Model<Worktree>>

source

pub fn visible_worktrees<'a>( &self, cx: &'a AppContext ) -> impl 'a + Iterator<Item = Model<Worktree>>

source

pub fn worktree_scans_complete( &self, cx: &AppContext ) -> impl Future<Output = ()> + 'static

source

pub fn close_global(_: &CloseWindow, cx: &mut AppContext)

source

pub fn close( &mut self, _: &CloseWindow, cx: &mut ViewContext<'_, Self> ) -> Option<Task<Result<()>>>

source

pub fn prepare_to_close( &mut self, quitting: bool, cx: &mut ViewContext<'_, Self> ) -> Task<Result<bool>>

source

pub fn open(&mut self, _: &Open, cx: &mut ViewContext<'_, Self>)

source

pub fn open_workspace_for_paths( &mut self, paths: Vec<PathBuf>, cx: &mut ViewContext<'_, Self> ) -> Task<Result<()>>

source

pub fn open_paths( &mut self, abs_paths: Vec<PathBuf>, visible: bool, cx: &mut ViewContext<'_, Self> ) -> Task<Vec<Option<Result<Box<dyn ItemHandle>, Error>>>>

source

pub fn items<'a>( &'a self, cx: &'a AppContext ) -> impl 'a + Iterator<Item = &Box<dyn ItemHandle>>

source

pub fn item_of_type<T: Item>(&self, cx: &AppContext) -> Option<View<T>>

source

pub fn items_of_type<'a, T: Item>( &'a self, cx: &'a AppContext ) -> impl 'a + Iterator<Item = View<T>>

source

pub fn active_item(&self, cx: &AppContext) -> Option<Box<dyn ItemHandle>>

source

pub fn active_item_as<I: 'static>(&self, cx: &AppContext) -> Option<View<I>>

source

pub fn save_active_item( &mut self, save_intent: SaveIntent, cx: &mut ViewContext<'_, Self> ) -> Task<Result<()>>

source

pub fn close_inactive_items_and_panes( &mut self, _: &CloseInactiveTabsAndPanes, cx: &mut ViewContext<'_, Self> )

source

pub fn close_all_items_and_panes( &mut self, action: &CloseAllItemsAndPanes, cx: &mut ViewContext<'_, Self> )

source

pub fn toggle_dock( &mut self, dock_side: DockPosition, cx: &mut ViewContext<'_, Self> )

source

pub fn close_all_docks(&mut self, cx: &mut ViewContext<'_, Self>)

source

pub fn focus_panel<T: Panel>( &mut self, cx: &mut ViewContext<'_, Self> ) -> Option<View<T>>

Transfer focus to the panel of the given type.

source

pub fn toggle_panel_focus<T: Panel>(&mut self, cx: &mut ViewContext<'_, Self>)

Focus the panel of the given type if it isn’t already focused. If it is already focused, then transfer focus back to the workspace center.

source

pub fn panel<T: Panel>(&self, cx: &WindowContext<'_>) -> Option<View<T>>

source

pub fn add_item( &mut self, item: Box<dyn ItemHandle>, cx: &mut ViewContext<'_, Self> )

source

pub fn split_item( &mut self, split_direction: SplitDirection, item: Box<dyn ItemHandle>, cx: &mut ViewContext<'_, Self> )

source

pub fn open_abs_path( &mut self, abs_path: PathBuf, visible: bool, cx: &mut ViewContext<'_, Self> ) -> Task<Result<Box<dyn ItemHandle>>>

source

pub fn split_abs_path( &mut self, abs_path: PathBuf, visible: bool, cx: &mut ViewContext<'_, Self> ) -> Task<Result<Box<dyn ItemHandle>>>

source

pub fn open_path( &mut self, path: impl Into<ProjectPath>, pane: Option<WeakView<Pane>>, focus_item: bool, cx: &mut ViewContext<'_, Self> ) -> Task<Result<Box<dyn ItemHandle>, Error>>

source

pub fn split_path( &mut self, path: impl Into<ProjectPath>, cx: &mut ViewContext<'_, Self> ) -> Task<Result<Box<dyn ItemHandle>, Error>>

source

pub fn open_project_item<T>( &mut self, project_item: Model<T::Item>, cx: &mut ViewContext<'_, Self> ) -> View<T>where T: ProjectItem,

source

pub fn split_project_item<T>( &mut self, project_item: Model<T::Item>, cx: &mut ViewContext<'_, Self> ) -> View<T>where T: ProjectItem,

source

pub fn activate_item( &mut self, item: &dyn ItemHandle, cx: &mut ViewContext<'_, Self> ) -> bool

source

pub fn activate_next_pane(&mut self, cx: &mut ViewContext<'_, Self>)

source

pub fn activate_previous_pane(&mut self, cx: &mut ViewContext<'_, Self>)

source

pub fn activate_pane_in_direction( &mut self, direction: SplitDirection, cx: &mut ViewContext<'_, Self> )

source

pub fn swap_pane_in_direction( &mut self, direction: SplitDirection, cx: &mut ViewContext<'_, Self> )

source

pub fn split_pane( &mut self, pane_to_split: View<Pane>, split_direction: SplitDirection, cx: &mut ViewContext<'_, Self> ) -> View<Pane>

source

pub fn split_and_clone( &mut self, pane: View<Pane>, direction: SplitDirection, cx: &mut ViewContext<'_, Self> ) -> Option<View<Pane>>

source

pub fn split_pane_with_item( &mut self, pane_to_split: WeakView<Pane>, split_direction: SplitDirection, from: WeakView<Pane>, item_id_to_move: EntityId, cx: &mut ViewContext<'_, Self> )

source

pub fn split_pane_with_project_entry( &mut self, pane_to_split: WeakView<Pane>, split_direction: SplitDirection, project_entry: ProjectEntryId, cx: &mut ViewContext<'_, Self> ) -> Option<Task<Result<()>>>

source

pub fn move_item( &mut self, source: View<Pane>, destination: View<Pane>, item_id_to_move: EntityId, destination_index: usize, cx: &mut ViewContext<'_, Self> )

source

pub fn panes(&self) -> &[View<Pane>]

source

pub fn active_pane(&self) -> &View<Pane>

source

pub fn unfollow( &mut self, pane: &View<Pane>, cx: &mut ViewContext<'_, Self> ) -> Option<PeerId>

source

pub fn leader_for_pane(&self, pane: &View<Pane>) -> Option<PeerId>

source

pub fn on_window_activation_changed(&mut self, cx: &mut ViewContext<'_, Self>)

source

pub fn database_id(&self) -> WorkspaceId

source

pub fn register_action<A: Action>( &mut self, callback: impl Fn(&mut Self, &A, &mut ViewContext<'_, Self>) + 'static ) -> &mut Self

source

pub fn active_modal<V: ManagedView + 'static>( &mut self, cx: &ViewContext<'_, Self> ) -> Option<View<V>>

source

pub fn toggle_modal<V: ManagedView, B>( &mut self, cx: &mut ViewContext<'_, Self>, build: B )where B: FnOnce(&mut ViewContext<'_, V>) -> V,

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,