pub struct TapeNodeRef<'a> {
pub kind: TapeNodeKind,
pub value: Option<TapeValue<'a>>,
pub format: FormatKind,
}Expand description
Reference to a tape node with metadata
Returned by TapeSource::node_at to provide information about a node
without copying the underlying data.
Fields§
§kind: TapeNodeKindThe kind of this node
value: Option<TapeValue<'a>>The value if this is a Value or Key node
format: FormatKindThe source format of the tape
Implementations§
Source§impl<'a> TapeNodeRef<'a>
impl<'a> TapeNodeRef<'a>
Sourcepub const fn new(
kind: TapeNodeKind,
value: Option<TapeValue<'a>>,
format: FormatKind,
) -> Self
pub const fn new( kind: TapeNodeKind, value: Option<TapeValue<'a>>, format: FormatKind, ) -> Self
Create a new node reference
Sourcepub const fn object_start(count: usize, format: FormatKind) -> Self
pub const fn object_start(count: usize, format: FormatKind) -> Self
Create an object start node
Sourcepub const fn object_end(format: FormatKind) -> Self
pub const fn object_end(format: FormatKind) -> Self
Create an object end node
Sourcepub const fn array_start(count: usize, format: FormatKind) -> Self
pub const fn array_start(count: usize, format: FormatKind) -> Self
Create an array start node
Sourcepub const fn array_end(format: FormatKind) -> Self
pub const fn array_end(format: FormatKind) -> Self
Create an array end node
Sourcepub const fn key(name: Cow<'a, str>, format: FormatKind) -> Self
pub const fn key(name: Cow<'a, str>, format: FormatKind) -> Self
Create a key node
Sourcepub const fn value(val: TapeValue<'a>, format: FormatKind) -> Self
pub const fn value(val: TapeValue<'a>, format: FormatKind) -> Self
Create a value node
Trait Implementations§
Source§impl<'a> Clone for TapeNodeRef<'a>
impl<'a> Clone for TapeNodeRef<'a>
Source§fn clone(&self) -> TapeNodeRef<'a>
fn clone(&self) -> TapeNodeRef<'a>
Returns a duplicate 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 moreAuto Trait Implementations§
impl<'a> Freeze for TapeNodeRef<'a>
impl<'a> RefUnwindSafe for TapeNodeRef<'a>
impl<'a> Send for TapeNodeRef<'a>
impl<'a> Sync for TapeNodeRef<'a>
impl<'a> Unpin for TapeNodeRef<'a>
impl<'a> UnwindSafe for TapeNodeRef<'a>
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