ConnectionImpl

Struct ConnectionImpl 

Source
pub struct ConnectionImpl<const SCOPED: bool> { /* private fields */ }
Expand description

The implementation used by both Connection and ScopedConnection. Takes a const bool parameter indicating whether it is a scoped connection or not.

Implementations§

Source§

impl<const SCOPED: bool> ConnectionImpl<SCOPED>

Source

pub fn connected(&self) -> bool

Returns true if the underlying slot is still connected, false otherwise. Will return false if the underlying signal no longer exists.

Source

pub fn disconnect(&self)

Disconnects the underlying slot. Further, repeated calls to disconnect will do nothing. When a connection is disconnected its underlying slot is permanently removed from the the signal’s slot list. Once disconnected, there is no way to re-connect a slot.

Source

pub fn blocked(&self) -> bool

Returns true if the underlying slot is blocked, false otherwise. Will return true if either the underyling slot or underlying signal no longer exists.

Source

pub fn blocker_count(&self) -> usize

Returns the number of SharedConnectionBlocks currently blocking the slot. Will return usize::Max if either the underyling slot or underlying signal no longer exists.

Source

pub fn shared_block(&self, initially_blocking: bool) -> SharedConnectionBlock

Gets a SharedConnectionBlock that can be used to temporarily block the underlying slot.

Source§

impl ConnectionImpl<false>

Source

pub fn scoped(self) -> ScopedConnection

Consumes the connection and returns a ScopedConnection.

Trait Implementations§

Source§

impl<const SCOPED: bool> Clone for ConnectionImpl<SCOPED>

Source§

fn clone(&self) -> ConnectionImpl<SCOPED>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const SCOPED: bool> Drop for ConnectionImpl<SCOPED>

Source§

fn drop(&mut self)

Disconnects the connection if and only if the connection is scoped.

Auto Trait Implementations§

§

impl<const SCOPED: bool> Freeze for ConnectionImpl<SCOPED>

§

impl<const SCOPED: bool> !RefUnwindSafe for ConnectionImpl<SCOPED>

§

impl<const SCOPED: bool> Send for ConnectionImpl<SCOPED>

§

impl<const SCOPED: bool> Sync for ConnectionImpl<SCOPED>

§

impl<const SCOPED: bool> Unpin for ConnectionImpl<SCOPED>

§

impl<const SCOPED: bool> !UnwindSafe for ConnectionImpl<SCOPED>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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