pub enum Index {
Key(InternalString),
Seq(usize),
Node(TreeID),
}
Variants§
Implementations§
source§impl Index
impl Index
sourcepub fn as_key_mut(&mut self) -> Option<&mut InternalString>
pub fn as_key_mut(&mut self) -> Option<&mut InternalString>
Optionally returns mutable references to the inner fields if this is a Index::Key
, otherwise None
sourcepub fn as_key(&self) -> Option<&InternalString>
pub fn as_key(&self) -> Option<&InternalString>
Optionally returns references to the inner fields if this is a Index::Key
, otherwise None
sourcepub fn into_key(self) -> Result<InternalString, Index>
pub fn into_key(self) -> Result<InternalString, Index>
Returns the inner fields if this is a Index::Key
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_seq_mut(&mut self) -> Option<&mut usize>
pub fn as_seq_mut(&mut self) -> Option<&mut usize>
Optionally returns mutable references to the inner fields if this is a Index::Seq
, otherwise None
sourcepub fn as_seq(&self) -> Option<&usize>
pub fn as_seq(&self) -> Option<&usize>
Optionally returns references to the inner fields if this is a Index::Seq
, otherwise None
sourcepub fn into_seq(self) -> Result<usize, Index>
pub fn into_seq(self) -> Result<usize, Index>
Returns the inner fields if this is a Index::Seq
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_node_mut(&mut self) -> Option<&mut TreeID>
pub fn as_node_mut(&mut self) -> Option<&mut TreeID>
Optionally returns mutable references to the inner fields if this is a Index::Node
, otherwise None
Trait Implementations§
source§impl<'de> Deserialize<'de> for Index
impl<'de> Deserialize<'de> for Index
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Index, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Index, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Index
impl PartialEq for Index
source§impl Serialize for Index
impl Serialize for Index
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Index
impl StructuralPartialEq for Index
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnwindSafe for Index
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more