pub struct DecoratorId(/* private fields */);
Expand description
An opaque handle to a Decorator
in some MastForest
. It is the responsibility of the user
to use a given DecoratorId
with the corresponding MastForest
.
Implementations§
Source§impl DecoratorId
impl DecoratorId
Sourcepub fn from_u32_safe(
value: u32,
mast_forest: &MastForest,
) -> Result<Self, DeserializationError>
pub fn from_u32_safe( value: u32, mast_forest: &MastForest, ) -> Result<Self, DeserializationError>
Returns a new DecoratorId
with the provided inner value, or an error if the provided
value
is greater than the number of nodes in the forest.
For use in deserialization.
pub fn as_usize(&self) -> usize
pub fn as_u32(&self) -> u32
Trait Implementations§
Source§impl Clone for DecoratorId
impl Clone for DecoratorId
Source§fn clone(&self) -> DecoratorId
fn clone(&self) -> DecoratorId
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DecoratorId
impl Debug for DecoratorId
Source§impl Display for DecoratorId
impl Display for DecoratorId
Source§impl From<&DecoratorId> for u32
impl From<&DecoratorId> for u32
Source§fn from(value: &DecoratorId) -> Self
fn from(value: &DecoratorId) -> Self
Converts to this type from the input type.
Source§impl From<DecoratorId> for u32
impl From<DecoratorId> for u32
Source§fn from(value: DecoratorId) -> Self
fn from(value: DecoratorId) -> Self
Converts to this type from the input type.
Source§impl From<DecoratorId> for usize
impl From<DecoratorId> for usize
Source§fn from(value: DecoratorId) -> Self
fn from(value: DecoratorId) -> Self
Converts to this type from the input type.
Source§impl Hash for DecoratorId
impl Hash for DecoratorId
Source§impl Index<DecoratorId> for MastForest
impl Index<DecoratorId> for MastForest
Source§impl IndexMut<DecoratorId> for MastForest
impl IndexMut<DecoratorId> for MastForest
Source§impl Ord for DecoratorId
impl Ord for DecoratorId
Source§fn cmp(&self, other: &DecoratorId) -> Ordering
fn cmp(&self, other: &DecoratorId) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DecoratorId
impl PartialEq for DecoratorId
Source§impl PartialOrd for DecoratorId
impl PartialOrd for DecoratorId
Source§impl Serializable for DecoratorId
impl Serializable for DecoratorId
Source§fn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
Serializes
self
into bytes and writes these bytes into the target
.Source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more
impl Copy for DecoratorId
impl Eq for DecoratorId
impl StructuralPartialEq for DecoratorId
Auto Trait Implementations§
impl Freeze for DecoratorId
impl RefUnwindSafe for DecoratorId
impl Send for DecoratorId
impl Sync for DecoratorId
impl Unpin for DecoratorId
impl UnwindSafe for DecoratorId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more