Skip to main content

Node

Struct Node 

Source
pub struct Node<V = Box<dyn Any>, K = TypeId, T = TypeId> { /* private fields */ }

Implementations§

Source§

impl<V, K: Eq + Hash, T> Node<V, K, T>

Source

pub fn new(tag: T) -> Self

Source

pub fn provide(&mut self, key: K, value: V) -> Result<(), V>

Source

pub fn into_arc(self) -> Arc<Self>

Source

pub fn parent(&self) -> Option<&Self>

Source§

impl<V, K: Eq + Hash> Node<V, K, TypeId>

Source

pub fn new_for<Tag: 'static>() -> Self

Source§

impl<V, T: PartialEq> Node<V, TypeId, T>

Source

pub fn extract_with<Key: TypeKey<E, V, T>, E: stdError + 'static>( &self, ) -> Result<MappedGuard<Box<RwLockReadGuard<'_, HashMap<TypeId, V>>>, &'_ V>, Error>

Source§

impl<V, K: Clone + Eq + Hash, T: PartialEq> Node<V, K, T>

Source

pub fn extract<E: stdError + 'static>( &self, key: K, provision: Provision<E, V, K, T>, ) -> Result<MappedGuard<Box<RwLockReadGuard<'_, HashMap<K, V>>>, &'_ V>, Error>

Auto Trait Implementations§

§

impl<V = Box<dyn Any>, K = TypeId, T = TypeId> !Freeze for Node<V, K, T>

§

impl<V, K, T> RefUnwindSafe for Node<V, K, T>
where T: RefUnwindSafe,

§

impl<V, K, T> Send for Node<V, K, T>
where T: Send + Sync, K: Send + Sync, V: Send + Sync,

§

impl<V, K, T> Sync for Node<V, K, T>
where T: Sync + Send, K: Send + Sync, V: Send + Sync,

§

impl<V, K, T> Unpin for Node<V, K, T>
where T: Unpin, K: Unpin, V: Unpin,

§

impl<V, K, T> UnsafeUnpin for Node<V, K, T>
where T: UnsafeUnpin,

§

impl<V, K, T> UnwindSafe for Node<V, K, T>

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