Skip to main content

HeldElement

Struct HeldElement 

Source
pub struct HeldElement<'a>(/* private fields */);
Expand description

An element a chain holds, as a comparison with a new element reads it: the element itself, or the node that keeps every value of it.

Implementations§

Source§

impl HeldElement<'_>

Source

pub fn element_type(&self) -> TypeId

The type of the element.

Source

pub fn node_type(&self) -> TypeId

The type of the node the element makes: its own type for a plain element, which makes none.

Source

pub fn capabilities(&self) -> NodeCapabilities

The capabilities of the element’s node.

Source

pub fn requires_update(&self) -> bool

Whether the element asks for an update of its node even when equal: one its node holds never does, nor does a plain one.

Source

pub fn is_kept_by_value(&self) -> bool

Whether the chain keeps the element’s values, in its node or as words, in place of the element. Such an element asks for no update when equal, and an element equal to it is of its type, so that one asks for none either.

Source

pub fn is(&self, element: &DynModifierElement) -> bool

Whether element is this element itself, not only an equal one.

Source

pub fn matches(&self, element: &DynModifierElement) -> bool

Whether element is this element itself, or one equal to it that asks for no update.

Source

pub fn equals(&self, element: &dyn AnyModifierElement) -> bool

Whether element is of this element’s type with equal data.

Source

pub fn plain<E: PlainElement>(&self) -> Option<E>

The element’s value, when the chain keeps it as words of an E.

Source

pub fn hash_code(&self) -> u64

The hash of the element, as the element itself hashes.

Source

pub fn to_element(&self) -> DynModifierElement

The element, made again from its node when the node holds it.

Trait Implementations§

Source§

impl<'a> Clone for HeldElement<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for HeldElement<'a>

Source§

impl<'a> From<&'a DynModifierElement> for HeldElement<'a>

Source§

fn from(element: &'a DynModifierElement) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for HeldElement<'a>

§

impl<'a> !Send for HeldElement<'a>

§

impl<'a> !Sync for HeldElement<'a>

§

impl<'a> !UnwindSafe for HeldElement<'a>

§

impl<'a> Forget for HeldElement<'a>

§

impl<'a> Freeze for HeldElement<'a>

§

impl<'a> Move for HeldElement<'a>

§

impl<'a> Unpin for HeldElement<'a>

§

impl<'a> UnsafeUnpin for HeldElement<'a>

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 = !

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.