pub enum ValueRef<'a> {
U64(u64),
I64(i64),
F64(f64),
Bool(bool),
Str(&'a str),
Bytes(&'a [u8]),
Json(&'a Value),
None,
Other(&'a Value),
}Expand description
A borrowed view of a Value (SRD 115 §6.1): what a compiled helper
or closure sees for an argument it does not own. A scalar is carried
by value, a string or byte string by reference into the arena or the
interner, a JSON value by reference into the value table, and any
other variant by reference to the Value itself. The P1 nodes build
the same view from their Value inputs, so one body serves both
tiers without copying a string argument to inspect it.
Variants§
U64(u64)
An unsigned integer.
I64(i64)
A signed integer.
F64(f64)
A float.
Bool(bool)
A boolean.
Str(&'a str)
A string, borrowed from the arena or the interner.
Bytes(&'a [u8])
A byte string, borrowed.
Json(&'a Value)
A JSON value, by reference into the value table.
None
No value.
Other(&'a Value)
Any other variant, by reference to the value.
Implementations§
Source§impl<'a> ValueRef<'a>
impl<'a> ValueRef<'a>
Sourcepub fn display(&self) -> Cow<'a, str>
pub fn display(&self) -> Cow<'a, str>
The display form, exactly as Value::to_display_string gives
it; a string is borrowed rather than copied.
Sourcepub fn to_display_string(&self) -> String
pub fn to_display_string(&self) -> String
The display form as an owned string.
Sourcepub fn to_json_value(&self) -> Value
pub fn to_json_value(&self) -> Value
The JSON projection, exactly as Value::to_json_value gives it.
Trait Implementations§
impl<'a> Copy for ValueRef<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ValueRef<'a>
impl<'a> !UnwindSafe for ValueRef<'a>
impl<'a> Freeze for ValueRef<'a>
impl<'a> Send for ValueRef<'a>
impl<'a> Sync for ValueRef<'a>
impl<'a> Unpin for ValueRef<'a>
impl<'a> UnsafeUnpin for ValueRef<'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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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