pub enum Value {
Bytes(Bytes),
Regex(ValueRegex),
Integer(i64),
Float(NotNan<f64>),
Boolean(bool),
Timestamp(DateTime<Utc>),
Object(BTreeMap<KeyString, Value>),
Array(Vec<Value>),
Null,
}
Expand description
The main value type used in Vector events, and VRL.
Variants§
Bytes(Bytes)
Bytes - usually representing a UTF8 String.
Regex(ValueRegex)
Regex. When used in the context of Vector this is treated identically to Bytes. It has additional meaning in the context of VRL.
Integer(i64)
Integer.
Float(NotNan<f64>)
Float - not NaN.
Boolean(bool)
Boolean.
Timestamp(DateTime<Utc>)
Timestamp (UTC).
Object(BTreeMap<KeyString, Value>)
Object.
Array(Vec<Value>)
Array.
Null
Null.
Implementations§
§impl Value
impl Value
pub fn as_float(&self) -> Option<NotNan<f64>>
pub fn as_float(&self) -> Option<NotNan<f64>>
Returns self as NotNan<f64>
, only if self is Value::Float
.
pub fn into_object(self) -> Option<BTreeMap<KeyString, Value>>
pub fn into_object(self) -> Option<BTreeMap<KeyString, Value>>
Returns self as ObjectMap
, only if self is Value::Object
.
pub fn as_timestamp(&self) -> Option<&DateTime<Utc>>
pub fn as_timestamp(&self) -> Option<&DateTime<Utc>>
Returns self as &DateTime<Utc>
, only if self is Value::Timestamp
.
pub fn as_timestamp_unwrap(&self) -> &DateTime<Utc>
pub fn as_timestamp_unwrap(&self) -> &DateTime<Utc>
Returns self as a DateTime<Utc>
.
§Panics
This function will panic if self is anything other than Value::Timestamp
.
pub fn as_object_mut_unwrap(&mut self) -> &mut BTreeMap<KeyString, Value>
pub fn as_object_mut_unwrap(&mut self) -> &mut BTreeMap<KeyString, Value>
Returns self as a mutable ObjectMap
.
§Panics
This function will panic if self is anything other than Value::Object
.
pub fn as_array_unwrap(&self) -> &[Value]
pub fn as_array_unwrap(&self) -> &[Value]
Returns self as a Vec<Value>
.
§Panics
This function will panic if self is anything other than Value::Array
.
pub fn as_array_mut_unwrap(&mut self) -> &mut Vec<Value>
pub fn as_array_mut_unwrap(&mut self) -> &mut Vec<Value>
Returns self as a mutable Vec<Value>
.
§Panics
This function will panic if self is anything other than Value::Array
.
pub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Returns true if self is Value::Integer
.
pub fn as_integer(&self) -> Option<i64>
pub fn as_integer(&self) -> Option<i64>
Returns self as f64
, only if self is Value::Integer
.
pub fn from_f64_or_zero(value: f64) -> Value
pub fn from_f64_or_zero(value: f64) -> Value
Creates a Value from an f64. If the value is Nan, it is converted to 0.0
§Panics
If NaN is used as a default value.
pub fn encode_as_bytes(&self) -> Result<Bytes, String>
pub fn encode_as_bytes(&self) -> Result<Bytes, String>
Converts the Value into a byte representation regardless of its original type. Object and Array are currently not supported, although technically there’s no reason why it couldn’t in future should the need arise.
§Errors
If the type is Object or Array, and string error description will be returned
pub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Returns true if self is Value::Boolean
.
pub fn as_boolean(&self) -> Option<bool>
pub fn as_boolean(&self) -> Option<bool>
Returns self as bool
, only if self is Value::Boolean
.
pub fn as_array_mut(&mut self) -> Option<&mut Vec<Value>>
pub fn as_array_mut(&mut self) -> Option<&mut Vec<Value>>
Returns self as &mut Vec<Value>
, only if self is Value::Array
.
pub fn as_object(&self) -> Option<&BTreeMap<KeyString, Value>>
pub fn as_object(&self) -> Option<&BTreeMap<KeyString, Value>>
Returns self as &ObjectMap
, only if self is Value::Object
.
pub fn as_object_mut(&mut self) -> Option<&mut BTreeMap<KeyString, Value>>
pub fn as_object_mut(&mut self) -> Option<&mut BTreeMap<KeyString, Value>>
Returns self as &mut ObjectMap
, only if self is Value::Object
.
pub fn is_timestamp(&self) -> bool
pub fn is_timestamp(&self) -> bool
Returns true if self is Value::Timestamp
.
pub fn kind(&self) -> Kind
pub fn kind(&self) -> Kind
Returns the Kind
of this Value
§impl Value
impl Value
pub fn into_iter<'a>(self, recursive: bool) -> ValueIter<'a>
pub fn into_iter<'a>(self, recursive: bool) -> ValueIter<'a>
Create an iterator over the Value
.
For non-collection types, this returns a single-item iterator similar to
Option
’s iterator implementation.
For collection types, it returns all elements in the collection.
The resulting item is an [IterItem
], which contains either a mutable
Value
for non-collection types, a (&mut KeyString
, &mut Value
) pair for
object-type collections, or an immutable/mutable (usize
, &mut Value
)
pair for array-type collections.
§Recursion
If recursion
is set to true
, the iterator recurses into nested
collection types.
Recursion follows these rules:
- When a collection type is found, that type is first returned as-is.
That is, if we’re iterating over an object, and within that object is
a field “foo” containing an array, then we first return
IterItem::KeyValue
, which contains the key “foo”, and the array as the value. - After returning the collection type, the iterator recurses into the
nested collection itself. Using the previous example, we now go into
the array, and start returning
IterItem::IndexValue
variants for the elements within the array. - Any mutations done to the array before recursing into it are preserved, meaning once recursion starts, the mutations done on the object itself are preserved.
§impl Value
impl Value
pub fn coerce_to_bytes(&self) -> Bytes
pub fn coerce_to_bytes(&self) -> Bytes
pub fn to_string_lossy(&self) -> Cow<'_, str>
pub fn to_string_lossy(&self) -> Cow<'_, str>
Converts self into a String
representation, using JSON for Map
/Array
.
§Panics
If map or array serialization fails.
§impl Value
impl Value
pub fn merge(&mut self, incoming: Value)
pub fn merge(&mut self, incoming: Value)
Merges incoming
value into self.
Will concatenate Bytes
and overwrite the rest value kinds.
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Return if the node is empty, that is, it is an array or map with no items.
use vrl::value::Value;
use std::collections::BTreeMap;
use vrl::path;
let val = Value::from(1);
assert_eq!(val.is_empty(), false);
let mut val = Value::from(Vec::<Value>::default());
assert_eq!(val.is_empty(), true);
val.insert(path!(0), 1);
assert_eq!(val.is_empty(), false);
val.insert(path!(3), 1);
assert_eq!(val.is_empty(), false);
let mut val = Value::from(BTreeMap::default());
assert_eq!(val.is_empty(), true);
val.insert(path!("foo"), 1);
assert_eq!(val.is_empty(), false);
val.insert(path!("bar"), 2);
assert_eq!(val.is_empty(), false);
pub fn insert<'a>(
&mut self,
path: impl ValuePath<'a>,
insert_value: impl Into<Value>,
) -> Option<Value>
pub fn insert<'a>( &mut self, path: impl ValuePath<'a>, insert_value: impl Into<Value>, ) -> Option<Value>
Returns a reference to a field value specified by a path iter.
pub fn remove<'a>(
&mut self,
path: impl ValuePath<'a>,
prune: bool,
) -> Option<Value>
pub fn remove<'a>( &mut self, path: impl ValuePath<'a>, prune: bool, ) -> Option<Value>
Removes field value specified by the given path and return its value.
A special case worth mentioning: if there is a nested array and an item is removed
from the middle of this array, then it is just replaced by Value::Null
.
pub fn get<'a>(&self, path: impl ValuePath<'a>) -> Option<&Value>
pub fn get<'a>(&self, path: impl ValuePath<'a>) -> Option<&Value>
Returns a reference to a field value specified by a path iter.
Trait Implementations§
source§impl ByteSizeOf for Value
impl ByteSizeOf for Value
§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
§fn deserialize<D>(
deserializer: D,
) -> Result<Value, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Value, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
source§impl EstimatedJsonEncodedSizeOf for Value
impl EstimatedJsonEncodedSizeOf for Value
fn estimated_json_encoded_size_of(&self) -> JsonSize
source§impl From<MetricKind> for Value
impl From<MetricKind> for Value
source§fn from(kind: MetricKind) -> Value
fn from(kind: MetricKind) -> Value
source§impl From<MetricSketch> for Value
impl From<MetricSketch> for Value
source§fn from(value: MetricSketch) -> Value
fn from(value: MetricSketch) -> Value
source§impl From<MetricValue> for Value
impl From<MetricValue> for Value
source§fn from(value: MetricValue) -> Value
fn from(value: MetricValue) -> Value
§impl FromIterator<(KeyString, Value)> for Value
impl FromIterator<(KeyString, Value)> for Value
§impl FromIterator<(String, Value)> for Value
impl FromIterator<(String, Value)> for Value
§impl FromIterator<Value> for Value
impl FromIterator<Value> for Value
§impl PartialOrd for Value
impl PartialOrd for Value
§fn partial_cmp(&self, other: &Value) -> Option<Ordering>
fn partial_cmp(&self, other: &Value) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more§impl SecretTarget for Value
impl SecretTarget for Value
fn get_secret(&self, _key: &str) -> Option<&str>
fn insert_secret(&mut self, _key: &str, _value: &str)
fn remove_secret(&mut self, _key: &str)
§impl Serialize for Value
impl Serialize for Value
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
§impl Target for Value
impl Target for Value
§fn target_get(
&self,
target_path: &OwnedTargetPath,
) -> Result<Option<&Value>, String>
fn target_get( &self, target_path: &OwnedTargetPath, ) -> Result<Option<&Value>, String>
None
if no value is found. Read more§impl TryFrom<Expr> for Value
impl TryFrom<Expr> for Value
Converts from an Expr
into a Value
. This is only possible if the expression represents
static values - Literal
s and Container
s containing Literal
s.
The error returns the expression back so it can be used in the error report.
source§impl TryFrom<Value> for MetricKind
impl TryFrom<Value> for MetricKind
§impl VrlValueArithmetic for Value
impl VrlValueArithmetic for Value
§fn try_mul(self, rhs: Value) -> Result<Value, ValueError>
fn try_mul(self, rhs: Value) -> Result<Value, ValueError>
Similar to std::ops::Mul
, but fallible (e.g. TryMul
).
§fn try_div(self, rhs: Value) -> Result<Value, ValueError>
fn try_div(self, rhs: Value) -> Result<Value, ValueError>
Similar to std::ops::Div
, but fallible (e.g. TryDiv
).
§fn try_add(self, rhs: Value) -> Result<Value, ValueError>
fn try_add(self, rhs: Value) -> Result<Value, ValueError>
Similar to std::ops::Add
, but fallible (e.g. TryAdd
).
§fn try_sub(self, rhs: Value) -> Result<Value, ValueError>
fn try_sub(self, rhs: Value) -> Result<Value, ValueError>
Similar to std::ops::Sub
, but fallible (e.g. TrySub
).
§fn try_or(
self,
rhs: impl FnMut() -> Result<Value, ExpressionError>,
) -> Result<Value, ValueError>
fn try_or( self, rhs: impl FnMut() -> Result<Value, ExpressionError>, ) -> Result<Value, ValueError>
Try to “OR” (||
) two values types.
If the lhs value is null
or false
, the rhs is evaluated and
returned. The rhs is a closure that can return an error, and thus this
method can return an error as well.
§fn try_and(self, rhs: Value) -> Result<Value, ValueError>
fn try_and(self, rhs: Value) -> Result<Value, ValueError>
Try to “AND” (&&
) two values types.
A lhs or rhs value of Null
returns false
.
§fn try_rem(self, rhs: Value) -> Result<Value, ValueError>
fn try_rem(self, rhs: Value) -> Result<Value, ValueError>
Similar to std::ops::Rem
, but fallible (e.g. TryRem
).
§fn try_gt(self, rhs: Value) -> Result<Value, ValueError>
fn try_gt(self, rhs: Value) -> Result<Value, ValueError>
Similar to std::cmp::Ord
, but fallible (e.g. TryOrd
).
§fn try_ge(self, rhs: Value) -> Result<Value, ValueError>
fn try_ge(self, rhs: Value) -> Result<Value, ValueError>
Similar to std::cmp::Ord
, but fallible (e.g. TryOrd
).
§fn try_lt(self, rhs: Value) -> Result<Value, ValueError>
fn try_lt(self, rhs: Value) -> Result<Value, ValueError>
Similar to std::cmp::Ord
, but fallible (e.g. TryOrd
).
§fn try_le(self, rhs: Value) -> Result<Value, ValueError>
fn try_le(self, rhs: Value) -> Result<Value, ValueError>
Similar to std::cmp::Ord
, but fallible (e.g. TryOrd
).
§fn eq_lossy(&self, rhs: &Value) -> bool
fn eq_lossy(&self, rhs: &Value) -> bool
Similar to std::cmp::Eq
, but does a lossless comparison for integers
and floats.
fn try_merge(self, rhs: Value) -> Result<Value, ValueError>
§impl VrlValueConvert for Value
impl VrlValueConvert for Value
§fn into_expression(self) -> Box<dyn Expression>
fn into_expression(self) -> Box<dyn Expression>
Convert a given Value
into a [Expression
] trait object.
fn try_integer(self) -> Result<i64, ValueError>
fn try_into_i64(&self) -> Result<i64, ValueError>
fn try_float(self) -> Result<f64, ValueError>
fn try_into_f64(&self) -> Result<f64, ValueError>
fn try_bytes(self) -> Result<Bytes, ValueError>
fn try_bytes_utf8_lossy(&self) -> Result<Cow<'_, str>, ValueError>
fn try_boolean(self) -> Result<bool, ValueError>
fn try_regex(self) -> Result<ValueRegex, ValueError>
fn try_null(self) -> Result<(), ValueError>
fn try_array(self) -> Result<Vec<Value>, ValueError>
fn try_object(self) -> Result<BTreeMap<KeyString, Value>, ValueError>
fn try_timestamp(self) -> Result<DateTime<Utc>, ValueError>
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl !Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<T> CallHasher for T
impl<T> CallHasher for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Conv for T
impl<T> Conv for T
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
§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
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> FromLuaMulti for Twhere
T: FromLua,
impl<T> FromLuaMulti for Twhere
T: FromLua,
§fn from_lua_multi(values: MultiValue, lua: &Lua) -> Result<T, Error>
fn from_lua_multi(values: MultiValue, lua: &Lua) -> Result<T, Error>
fn from_lua_args( args: MultiValue, i: usize, to: Option<&str>, lua: &Lua, ) -> Result<T, Error>
unsafe fn from_stack_multi(nvals: i32, lua: &RawLua) -> Result<T, Error>
unsafe fn from_stack_args( nargs: i32, i: usize, to: Option<&str>, lua: &RawLua, ) -> Result<T, Error>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> 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> ⓘ
§impl<T> IntoLuaMulti for Twhere
T: IntoLua,
impl<T> IntoLuaMulti for Twhere
T: IntoLua,
§fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
unsafe fn push_into_stack_multi(self, lua: &RawLua) -> Result<i32, Error>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
§fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize(&self, serializer: &mut dyn Serializer)
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()
] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString
]. Read more