Skip to main content

ClientView

Struct ClientView 

Source
pub struct ClientView<'a, W: Wrap> { /* private fields */ }

Implementations§

Source§

impl<'a, W: WrapRef> ClientView<'a, W>

Source

pub fn new( fs: &'a Arc<dyn Fs + Send + Sync>, home: &'a Utf8Path, session: W::WrapRef<'a, Session>, state: W::WrapRef<'a, ClientState>, ) -> Self

Source

pub fn session(&self) -> &Session

Source

pub fn fs(&self) -> &'a Arc<dyn Fs + Send + Sync> ⓘ

Source

pub fn home(&self) -> &Utf8Path

Source

pub fn absolute_path(&self, path: &Utf8Path) -> Utf8PathBuf

Source

pub fn display_path(&self, path: &Utf8Path) -> String

Source

pub fn focused_buffer(&self) -> &Buffer

Source

pub fn get_window(&self, window_key: WindowKey) -> Option<Window<'_>>

Source

pub fn focused_window(&self) -> Window<'_>

Source

pub fn assert_invariants(&self) -> Result<()>

Source§

impl<W: WrapMut> ClientView<'_, W>

Source

pub fn session_mut(&mut self) -> &mut Session

Source

pub fn focused_buffer_mut(&mut self) -> &mut Buffer

Source

pub fn focus_window(&mut self, window_key: WindowKey) -> bool

Source

pub fn get_window_mut(&mut self, window_key: WindowKey) -> Option<WindowMut<'_>>

Source

pub fn focused_window_mut(&mut self) -> WindowMut<'_>

Source§

impl ClientView<'_, WMut>

Source

pub fn handle_event(&mut self, event: Event) -> Result<bool>

Methods from Deref<Target = ClientState>§

Source

pub fn message(&self) -> Option<Result<&str, &str>>

Source

pub fn set_message(&mut self, message: impl Into<Cow<'static, str>>)

Source

pub fn set_error(&mut self, message: impl Into<Cow<'static, str>>)

Source

pub fn clear_message(&mut self)

Source

pub fn exit(&mut self, exit_code: u8)

Doesn’t actually terminate the process, just records the desired exit code.

Trait Implementations§

Source§

impl<W: WrapRef> Deref for ClientView<'_, W>

Source§

type Target = ClientState

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<W: WrapMut> DerefMut for ClientView<'_, W>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, W> !RefUnwindSafe for ClientView<'a, W>

§

impl<'a, W> !UnwindSafe for ClientView<'a, W>

§

impl<'a, W> Freeze for ClientView<'a, W>
where <W as Wrap>::Wrap<'a, ClientState>: Freeze, <W as Wrap>::Wrap<'a, Session>: Freeze,

§

impl<'a, W> Send for ClientView<'a, W>
where <W as Wrap>::Wrap<'a, ClientState>: Send, <W as Wrap>::Wrap<'a, Session>: Send,

§

impl<'a, W> Sync for ClientView<'a, W>
where <W as Wrap>::Wrap<'a, ClientState>: Sync, <W as Wrap>::Wrap<'a, Session>: Sync,

§

impl<'a, W> Unpin for ClientView<'a, W>
where <W as Wrap>::Wrap<'a, ClientState>: Unpin, <W as Wrap>::Wrap<'a, Session>: Unpin,

§

impl<'a, W> UnsafeUnpin for ClientView<'a, W>
where <W as Wrap>::Wrap<'a, ClientState>: UnsafeUnpin, <W as Wrap>::Wrap<'a, Session>: UnsafeUnpin,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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.

Source§

impl<I> FromItem<I> for I

Source§

fn from_item(item: I) -> I

§

impl<T> Instrument for T

§

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

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

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 T
where 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.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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