pub enum FragmentRef<'a, T, B> {
IndexEntry(&'a str),
IndexKey,
IndexValue(&'a str),
Object(&'a Object<T, B>),
IndexedObject(&'a Indexed<Object<T, B>>),
Node(&'a Node<T, B>),
IndexedNode(&'a IndexedNode<T, B>),
IndexedNodeList(&'a [IndexedNode<T, B>]),
ValueFragment(FragmentRef<'a, T>),
ListFragment(FragmentRef<'a, T, B>),
NodeFragment(FragmentRef<'a, T, B>),
}Expand description
Object fragment.
Variants§
IndexEntry(&'a str)
“@index” entry.
IndexKey
“@index” entry key.
IndexValue(&'a str)
“@index” entry value.
Object(&'a Object<T, B>)
Object.
IndexedObject(&'a Indexed<Object<T, B>>)
Indexed object.
Node(&'a Node<T, B>)
Node object.
IndexedNode(&'a IndexedNode<T, B>)
Indexed node object.
IndexedNodeList(&'a [IndexedNode<T, B>])
Indexed node list.
ValueFragment(FragmentRef<'a, T>)
Value object fragment.
ListFragment(FragmentRef<'a, T, B>)
List object fragment.
NodeFragment(FragmentRef<'a, T, B>)
Node object fragment.
Implementations§
Source§impl<'a, T, B> FragmentRef<'a, T, B>
impl<'a, T, B> FragmentRef<'a, T, B>
Sourcepub fn into_ref(self) -> Option<Ref<'a, T, B>>
pub fn into_ref(self) -> Option<Ref<'a, T, B>>
Returns the object this fragment stands for, if it is one.
Sourcepub fn into_id(self) -> Option<Id<&'a T, &'a B>>
pub fn into_id(self) -> Option<Id<&'a T, &'a B>>
Returns the identifier this fragment stands for, if it is one.
Sourcepub fn as_id(&self) -> Option<Id<&'a T, &'a B>>
pub fn as_id(&self) -> Option<Id<&'a T, &'a B>>
Returns the identifier this fragment stands for, if it is one.
Sourcepub fn is_json_array(&self) -> bool
pub fn is_json_array(&self) -> bool
Checks whether this fragment renders as a JSON array.
Sourcepub fn is_json_object(&self) -> bool
pub fn is_json_object(&self) -> bool
Checks whether this fragment renders as a JSON object.
Sourcepub fn sub_fragments(&self) -> SubFragments<'a, T, B> ⓘ
pub fn sub_fragments(&self) -> SubFragments<'a, T, B> ⓘ
Returns an iterator over the fragments directly contained in this one.
Auto Trait Implementations§
impl<'a, T, B> Freeze for FragmentRef<'a, T, B>
impl<'a, T, B> RefUnwindSafe for FragmentRef<'a, T, B>where
&'a Object<T, B>: RefUnwindSafe,
&'a Indexed<Object<T, B>>: RefUnwindSafe,
&'a Node<T, B>: RefUnwindSafe,
&'a Indexed<Node<T, B>>: RefUnwindSafe,
&'a [Indexed<Node<T, B>>]: RefUnwindSafe,
FragmentRef<'a, T>: RefUnwindSafe,
FragmentRef<'a, T, B>: RefUnwindSafe,
FragmentRef<'a, T, B>: RefUnwindSafe,
impl<'a, T, B> Send for FragmentRef<'a, T, B>
impl<'a, T, B> Sync for FragmentRef<'a, T, B>
impl<'a, T, B> Unpin for FragmentRef<'a, T, B>
impl<'a, T, B> UnsafeUnpin for FragmentRef<'a, T, B>where
&'a Object<T, B>: UnsafeUnpin,
&'a Indexed<Object<T, B>>: UnsafeUnpin,
&'a Node<T, B>: UnsafeUnpin,
&'a Indexed<Node<T, B>>: UnsafeUnpin,
&'a [Indexed<Node<T, B>>]: UnsafeUnpin,
FragmentRef<'a, T>: UnsafeUnpin,
FragmentRef<'a, T, B>: UnsafeUnpin,
FragmentRef<'a, T, B>: UnsafeUnpin,
impl<'a, T, B> UnwindSafe for FragmentRef<'a, T, B>where
&'a Object<T, B>: UnwindSafe,
&'a Indexed<Object<T, B>>: UnwindSafe,
&'a Node<T, B>: UnwindSafe,
&'a Indexed<Node<T, B>>: UnwindSafe,
&'a [Indexed<Node<T, B>>]: UnwindSafe,
FragmentRef<'a, T>: UnwindSafe,
FragmentRef<'a, T, B>: UnwindSafe,
FragmentRef<'a, T, B>: UnwindSafe,
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
Source§fn as_unordered(&self) -> &Unordered<T>
fn as_unordered(&self) -> &Unordered<T>
Views this value as an
Unordered reference.