Skip to main content

Lock

Struct Lock 

Source
pub struct Lock { /* private fields */ }
Expand description

A SessionLock as the platform holds it: whether the config wants the session locked, what the compositor says, and each output’s lock surface. Dropping it disposes its owner, which frees everything it made.

Implementations§

Source§

impl Lock

Source

pub fn new(cx: &Cx, lock: SessionLock) -> Lock

Builds lock under a new child owner of cx. A locked binding is an effect, so it first runs at the next flush.

§Panics

If cx’s owner was disposed, as Cx::signal does.

Source

pub fn wanted(&self) -> Option<bool>

Whether locked says to lock; None once the lock’s owner is gone.

Source

pub fn locked(&self) -> ReadSignal<bool>

true while the compositor says the session is locked.

Source

pub fn set_locked(&self, locked: bool)

Records what the compositor said; a value it holds already is left alone, so nothing reruns.

Source

pub fn surface(&self, output: &Output) -> Option<Window>

Builds output’s lock surface under a new child owner, its path SessionLock[DP-1]. A surface builder that panics is logged with that path, and the surface shows only the lock’s style. None once the lock’s owner is gone.

Trait Implementations§

Source§

impl Drop for Lock

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Lock

§

impl !Send for Lock

§

impl !Sync for Lock

§

impl !UnwindSafe for Lock

§

impl Forget for Lock

§

impl Freeze for Lock

§

impl Move for Lock

§

impl Unpin for Lock

§

impl UnsafeUnpin for Lock

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