[−][src]Struct revent::Single
Single slot containing T
.
A single
is a container for a single Node. It ensures that a single node always
exists, panicking if not present on access. In addition, no more than a single node may
subscribe to this container at a time.
Methods
impl<T: ?Sized> Single<T>
[src]
pub fn new(name: &'static str, manager: &Manager) -> Self
[src]
Create a new single object.
The manager is used to organize multiple single/slot objects and to ensure that there are no recursive (double mutable borrow) signal chains.
name
is used for error reporting and graph generation in Manager.
pub fn emit<F, R>(&mut self, caller: F) -> R where
F: FnMut(&mut T) -> R,
[src]
F: FnMut(&mut T) -> R,
Emit a signal on this signal single.
Panics if no node is subscribed to this single.
pub fn register(&mut self, item: Rc<RefCell<T>>)
[src]
Add or remove a node object to this single.
The action taken depends on whether Anchor::subscribe or Anchor::unsubscribe was called.
Panics
Panics if called from Anchor::unsubscribe while not being registered.
Panics from a Anchor::subscribe context if an object is already
registered with this Single
.
Trait Implementations
impl<T: ?Sized> Clone for Single<T>
[src]
fn clone(&self) -> Self
[src]
Cloning is only valid from within an Anchor::subscribe context.
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: ?Sized> Debug for Single<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Single<T>
impl<T> !Send for Single<T>
impl<T> !Sync for Single<T>
impl<T: ?Sized> Unpin for Single<T>
impl<T> !UnwindSafe for Single<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,