Expand description
A literal value or a reference to a value in a metadata map.
Variants
Reference(Reference)
Literal(Value)
Implementations
sourceimpl Symbol
impl Symbol
pub fn as_literal(&self) -> Option<&Value>
pub fn as_reference(&self) -> Option<&Reference>
sourcepub fn resolve<'literal: 'metadata, 'metadata>(
&'literal self,
metadata: &'metadata DynamicMetadata
) -> Option<&'metadata Value>
pub fn resolve<'literal: 'metadata, 'metadata>(
&'literal self,
metadata: &'metadata DynamicMetadata
) -> Option<&'metadata Value>
Resolves a symbol into a Value
, using ctx
for any references,
returning None
if could not be found.
sourcepub fn resolve_to_bytes<'literal: 'metadata, 'metadata>(
&'literal self,
metadata: &'metadata DynamicMetadata
) -> Option<Bytes>
pub fn resolve_to_bytes<'literal: 'metadata, 'metadata>(
&'literal self,
metadata: &'metadata DynamicMetadata
) -> Option<Bytes>
Tries to Self::resolve
the symbol to a bytes::Bytes
, performing
a conversion process on different Value
if relevant. Returning
None
if it isn’t supported currently.
Value::Bytes
The value is copied as-is.Value::String
The value is interpreted as a base64 string.Value::Number
The value is an eight byte number encoded as big endian.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Symbol
impl<'de> Deserialize<'de> for Symbol
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl JsonSchema for Symbol
impl JsonSchema for Symbol
sourcefn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresourceimpl Ord for Symbol
impl Ord for Symbol
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Symbol> for Symbol
impl PartialOrd<Symbol> for Symbol
sourcefn partial_cmp(&self, other: &Symbol) -> Option<Ordering>
fn partial_cmp(&self, other: &Symbol) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Symbol
impl StructuralEq for Symbol
impl StructuralPartialEq for Symbol
Auto Trait Implementations
impl RefUnwindSafe for Symbol
impl Send for Symbol
impl Sync for Symbol
impl Unpin for Symbol
impl UnwindSafe for Symbol
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.impl<T> FromRef<T> for Twhere
T: Clone,
impl<T> FromRef<T> for Twhere
T: Clone,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request