Enum rsonpath::automaton::TransitionLabel
source · pub enum TransitionLabel<'q> {
ObjectMember(&'q JsonString),
ArrayIndex(JsonUInt),
}
Expand description
Represent the distinct methods of moving on a match between states.
Variants§
ObjectMember(&'q JsonString)
Transition when a JSON member name matches a JsonString
i.
ArrayIndex(JsonUInt)
Transition on the n-th element of an array, with n specified by a JsonUInt
.
Implementations§
source§impl<'q> TransitionLabel<'q>
impl<'q> TransitionLabel<'q>
sourcepub fn get_member_name(&self) -> Option<&'q JsonString>
pub fn get_member_name(&self) -> Option<&'q JsonString>
Return the textual JsonString
being wrapped if so. Returns None
otherwise.
sourcepub fn get_array_index(&'q self) -> Option<&'q JsonUInt>
pub fn get_array_index(&'q self) -> Option<&'q JsonUInt>
sourcepub fn new_object_member(member_name: &'q JsonString) -> Self
pub fn new_object_member(member_name: &'q JsonString) -> Self
Wraps a JsonString
in a TransitionLabel
.
sourcepub fn new_array_index(index: JsonUInt) -> Self
pub fn new_array_index(index: JsonUInt) -> Self
Wraps a JsonUInt
in a TransitionLabel
.
Trait Implementations§
source§impl<'q> Clone for TransitionLabel<'q>
impl<'q> Clone for TransitionLabel<'q>
source§fn clone(&self) -> TransitionLabel<'q>
fn clone(&self) -> TransitionLabel<'q>
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<'q> Debug for TransitionLabel<'q>
impl<'q> Debug for TransitionLabel<'q>
source§impl Display for TransitionLabel<'_>
impl Display for TransitionLabel<'_>
source§impl<'q> From<&'q JsonString> for TransitionLabel<'q>
impl<'q> From<&'q JsonString> for TransitionLabel<'q>
source§fn from(member_name: &'q JsonString) -> Self
fn from(member_name: &'q JsonString) -> Self
Converts to this type from the input type.
source§impl From<JsonUInt> for TransitionLabel<'_>
impl From<JsonUInt> for TransitionLabel<'_>
source§impl<'q> PartialEq for TransitionLabel<'q>
impl<'q> PartialEq for TransitionLabel<'q>
source§fn eq(&self, other: &TransitionLabel<'q>) -> bool
fn eq(&self, other: &TransitionLabel<'q>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'q> Copy for TransitionLabel<'q>
impl<'q> Eq for TransitionLabel<'q>
impl<'q> StructuralEq for TransitionLabel<'q>
impl<'q> StructuralPartialEq for TransitionLabel<'q>
Auto Trait Implementations§
impl<'q> RefUnwindSafe for TransitionLabel<'q>
impl<'q> Send for TransitionLabel<'q>
impl<'q> Sync for TransitionLabel<'q>
impl<'q> Unpin for TransitionLabel<'q>
impl<'q> UnwindSafe for TransitionLabel<'q>
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