[][src]Struct vgtk::Scope

pub struct Scope<C: Component> { /* fields omitted */ }

A channel for sending messages to a Component.

Methods

impl<C: 'static + Component> Scope<C>[src]

pub fn try_send(
    &self,
    message: C::Message
) -> Result<(), TrySendError<C::Message>>
[src]

Attempt to send a message to the component this Scope belongs to.

This should always succeed if the component is running.

If you receive an error, this generally means the component has unmounted and the scope has become invalid.

If the message is sent successfully, it will show up at your component's Component::update() method presently.

Never call this from inside a signal handler. It's important that you follow the usual pattern of returning messages from signal handler closures, or you risk unexpected side effects and potential infinite loops.

pub fn name(&self) -> &'static str[src]

Get the name of the component this Scope belongs to.

Trait Implementations

impl<C: Component> Clone for Scope<C>[src]

impl<C: Component> Debug for Scope<C>[src]

impl<C: Component> Eq for Scope<C>[src]

impl<C: Component> Hash for Scope<C>[src]

impl<C: Component> PartialEq<Scope<C>> for Scope<C>[src]

fn eq(&self, other: &Self) -> bool[src]

Test whether two Scopes are equal.

Two scopes are considered equal if they belong to the same component instance, in other words if they send their messages to the same destination.

Auto Trait Implementations

impl<C> !RefUnwindSafe for Scope<C>

impl<C> Send for Scope<C> where
    <C as Component>::Message: Send

impl<C> Sync for Scope<C> where
    <C as Component>::Message: Send

impl<C> Unpin for Scope<C>

impl<C> !UnwindSafe for Scope<C>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.