pub(crate) struct Scalar {
text: String,
offset: usize,
}Expand description
A literal token: the source text of a string, number, or keyword.
Fields§
§text: String§offset: usizeThe byte offset of the token in the parsed source, zero for a built scalar.
Implementations§
Source§impl Scalar
impl Scalar
Sourcepub(in json) const fn from_source(
text: String,
offset: usize,
) -> Self
pub(in json) const fn from_source( text: String, offset: usize, ) -> Self
Wrap the source text of one literal token that starts at offset.
pub(in json) const fn offset( &self, ) -> usize
pub(in json) fn text( &self, ) -> &str
pub(super) fn build(leaf: &Leaf, dialect: Dialect) -> Self
Trait Implementations§
impl Eq for Scalar
impl StructuralPartialEq for Scalar
Auto Trait Implementations§
impl Freeze for Scalar
impl RefUnwindSafe for Scalar
impl Send for Scalar
impl Sync for Scalar
impl Unpin for Scalar
impl UnsafeUnpin for Scalar
impl UnwindSafe for Scalar
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.