#[non_exhaustive]pub enum AnyValue {
Show 13 variants
BoolListValue(Vec<bool>),
BoolValue(bool),
DoubleListValue(Vec<f64>),
DoubleValue(f64),
FloatListValue(Vec<f32>),
FloatValue(f32),
IntListValue(Vec<i32>),
IntValue(i32),
LongListValue(Vec<i64>),
LongValue(i64),
StringListValue(Vec<String>),
StringValue(String),
#[non_exhaustive] Unknown,
}Expand description
The value of a property on a node or an edge in an agent context. Exactly one member is set, and the member that is set determines the value's type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BoolListValue(Vec<bool>)
A list of up to 1,000 Boolean values.
BoolValue(bool)
A Boolean value.
DoubleListValue(Vec<f64>)
A list of up to 1,000 double-precision (64-bit) floating-point values.
DoubleValue(f64)
A double-precision (64-bit) floating-point value.
FloatListValue(Vec<f32>)
A list of up to 1,000 single-precision (32-bit) floating-point values.
FloatValue(f32)
A single-precision (32-bit) floating-point value.
IntListValue(Vec<i32>)
A list of up to 1,000 32-bit signed integer values.
IntValue(i32)
A 32-bit signed integer value.
LongListValue(Vec<i64>)
A list of up to 1,000 64-bit signed integer values.
LongValue(i64)
A 64-bit signed integer value.
StringListValue(Vec<String>)
A list of up to 1,000 string values, each up to 2,048 characters.
StringValue(String)
A string value, up to 2,048 characters.
#[non_exhaustive]Unknown
The Unknown variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
An unknown enum variant
Note: If you encounter this error, consider upgrading your SDK to the latest version.
The Unknown variant represents cases where the server sent a value that wasn’t recognized
by the client. This can happen when the server adds new functionality, but the client has not been updated.
To investigate this, consider turning on debug logging to print the raw HTTP response.
Implementations§
Source§impl AnyValue
impl AnyValue
Sourcepub fn as_bool_list_value(&self) -> Result<&Vec<bool>, &Self>
pub fn as_bool_list_value(&self) -> Result<&Vec<bool>, &Self>
Tries to convert the enum instance into BoolListValue, extracting the inner Vec.
Returns Err(&Self) if it can’t be converted.
Sourcepub fn is_bool_list_value(&self) -> bool
pub fn is_bool_list_value(&self) -> bool
Returns true if this is a BoolListValue.
Sourcepub fn as_bool_value(&self) -> Result<&bool, &Self>
pub fn as_bool_value(&self) -> Result<&bool, &Self>
Sourcepub fn is_bool_value(&self) -> bool
pub fn is_bool_value(&self) -> bool
Returns true if this is a BoolValue.
Sourcepub fn as_double_list_value(&self) -> Result<&Vec<f64>, &Self>
pub fn as_double_list_value(&self) -> Result<&Vec<f64>, &Self>
Tries to convert the enum instance into DoubleListValue, extracting the inner Vec.
Returns Err(&Self) if it can’t be converted.
Sourcepub fn is_double_list_value(&self) -> bool
pub fn is_double_list_value(&self) -> bool
Returns true if this is a DoubleListValue.
Sourcepub fn as_double_value(&self) -> Result<&f64, &Self>
pub fn as_double_value(&self) -> Result<&f64, &Self>
Tries to convert the enum instance into DoubleValue, extracting the inner f64.
Returns Err(&Self) if it can’t be converted.
Sourcepub fn is_double_value(&self) -> bool
pub fn is_double_value(&self) -> bool
Returns true if this is a DoubleValue.
Sourcepub fn as_float_list_value(&self) -> Result<&Vec<f32>, &Self>
pub fn as_float_list_value(&self) -> Result<&Vec<f32>, &Self>
Tries to convert the enum instance into FloatListValue, extracting the inner Vec.
Returns Err(&Self) if it can’t be converted.
Sourcepub fn is_float_list_value(&self) -> bool
pub fn is_float_list_value(&self) -> bool
Returns true if this is a FloatListValue.
Sourcepub fn as_float_value(&self) -> Result<&f32, &Self>
pub fn as_float_value(&self) -> Result<&f32, &Self>
Tries to convert the enum instance into FloatValue, extracting the inner f32.
Returns Err(&Self) if it can’t be converted.
Sourcepub fn is_float_value(&self) -> bool
pub fn is_float_value(&self) -> bool
Returns true if this is a FloatValue.
Sourcepub fn as_int_list_value(&self) -> Result<&Vec<i32>, &Self>
pub fn as_int_list_value(&self) -> Result<&Vec<i32>, &Self>
Tries to convert the enum instance into IntListValue, extracting the inner Vec.
Returns Err(&Self) if it can’t be converted.
Sourcepub fn is_int_list_value(&self) -> bool
pub fn is_int_list_value(&self) -> bool
Returns true if this is a IntListValue.
Sourcepub fn as_int_value(&self) -> Result<&i32, &Self>
pub fn as_int_value(&self) -> Result<&i32, &Self>
Sourcepub fn is_int_value(&self) -> bool
pub fn is_int_value(&self) -> bool
Returns true if this is a IntValue.
Sourcepub fn as_long_list_value(&self) -> Result<&Vec<i64>, &Self>
pub fn as_long_list_value(&self) -> Result<&Vec<i64>, &Self>
Tries to convert the enum instance into LongListValue, extracting the inner Vec.
Returns Err(&Self) if it can’t be converted.
Sourcepub fn is_long_list_value(&self) -> bool
pub fn is_long_list_value(&self) -> bool
Returns true if this is a LongListValue.
Sourcepub fn as_long_value(&self) -> Result<&i64, &Self>
pub fn as_long_value(&self) -> Result<&i64, &Self>
Sourcepub fn is_long_value(&self) -> bool
pub fn is_long_value(&self) -> bool
Returns true if this is a LongValue.
Sourcepub fn as_string_list_value(&self) -> Result<&Vec<String>, &Self>
pub fn as_string_list_value(&self) -> Result<&Vec<String>, &Self>
Tries to convert the enum instance into StringListValue, extracting the inner Vec.
Returns Err(&Self) if it can’t be converted.
Sourcepub fn is_string_list_value(&self) -> bool
pub fn is_string_list_value(&self) -> bool
Returns true if this is a StringListValue.
Sourcepub fn as_string_value(&self) -> Result<&String, &Self>
pub fn as_string_value(&self) -> Result<&String, &Self>
Tries to convert the enum instance into StringValue, extracting the inner String.
Returns Err(&Self) if it can’t be converted.
Sourcepub fn is_string_value(&self) -> bool
pub fn is_string_value(&self) -> bool
Returns true if this is a StringValue.
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if the enum instance is the Unknown variant.
Trait Implementations§
impl StructuralPartialEq for AnyValue
Auto Trait Implementations§
impl Forget for AnyValue
impl Freeze for AnyValuewhere
*const u8 is !null: Freeze,
PhantomData<bool>: Freeze,
PhantomData<f64>: Freeze,
PhantomData<f32>: Freeze,
PhantomData<i32>: Freeze,
PhantomData<i64>: Freeze,
PhantomData<String>: Freeze,
PhantomData<u8>: Freeze,
impl Move for AnyValue
impl RefUnwindSafe for AnyValue
impl Send for AnyValuewhere
RawVecInner: Send,
impl Sync for AnyValuewhere
RawVecInner: Sync,
impl Unpin for AnyValue
impl UnsafeUnpin for AnyValuewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<bool>: UnsafeUnpin,
PhantomData<f64>: UnsafeUnpin,
PhantomData<f32>: UnsafeUnpin,
PhantomData<i32>: UnsafeUnpin,
PhantomData<i64>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for AnyValuewhere
RawVecInner: 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
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);