Kind

Struct Kind 

Source
pub struct Kind { /* private fields */ }
Expand description

The type (kind) of a given value.

This struct tracks the known states a type can have. By allowing one type to have multiple states, the type definition can be progressively refined.

Implementations§

Source§

impl Kind

Source

pub fn any() -> Self

The “any” type state.

This state implies all states for the type are valid. There is no known information that can be gleaned from the type.

Source

pub fn json() -> Self

The “json” type state.

This state is similar to any, except that it excludes any types that can’t be represented in a native JSON-type (such as timestamp and regex).

Source

pub const fn bytes() -> Self

The “bytes” type state.

Source

pub const fn integer() -> Self

The “integer” type state.

Source

pub const fn float() -> Self

The “float” type state.

Source

pub const fn boolean() -> Self

The “boolean” type state.

Source

pub const fn timestamp() -> Self

The “timestamp” type state.

Source

pub const fn regex() -> Self

The “regex” type state.

Source

pub const fn null() -> Self

The “null” type state.

Source

pub const fn undefined() -> Self

The “undefined” type state.

Source

pub const fn never() -> Self

The “never” type state.

Source

pub fn array(collection: impl Into<Collection<Index>>) -> Self

The “array” type state.

Source

pub fn object(collection: impl Into<Collection<Field>>) -> Self

The “object” type state.

Source

pub fn any_object() -> Self

An object that can have any fields.

Source§

impl Kind

Source

pub const fn or_bytes(self) -> Self

Add the bytes state to the type.

Source

pub const fn or_integer(self) -> Self

Add the integer state to the type.

Source

pub const fn or_float(self) -> Self

Add the float state to the type.

Source

pub const fn or_boolean(self) -> Self

Add the boolean state to the type.

Source

pub const fn or_timestamp(self) -> Self

Add the timestamp state to the type.

Source

pub const fn or_regex(self) -> Self

Add the regex state to the type.

Source

pub const fn or_null(self) -> Self

Add the null state to the type.

Source

pub const fn or_undefined(self) -> Self

Add the undefined state to the type.

Source

pub fn or_array(self, collection: impl Into<Collection<Index>>) -> Self

Add the array state to the type.

Source

pub fn or_object(self, collection: impl Into<Collection<Field>>) -> Self

Add the object state to the type.

Source§

impl Kind

Source

pub fn add_bytes(&mut self) -> bool

Add the bytes state to the type.

If the type already included this state, the function returns false.

Source

pub fn add_integer(&mut self) -> bool

Add the integer state to the type.

If the type already included this state, the function returns false.

Source

pub fn add_float(&mut self) -> bool

Add the float state to the type.

If the type already included this state, the function returns false.

Source

pub fn add_boolean(&mut self) -> bool

Add the boolean state to the type.

If the type already included this state, the function returns false.

Source

pub fn add_timestamp(&mut self) -> bool

Add the timestamp state to the type.

If the type already included this state, the function returns false.

Source

pub fn add_regex(&mut self) -> bool

Add the regex state to the type.

If the type already included this state, the function returns false.

Source

pub fn add_null(&mut self) -> bool

Add the null state to the type.

If the type already included this state, the function returns false.

Source

pub fn add_undefined(&mut self) -> bool

Add the null state to the type.

If the type already included this state, the function returns false.

Source

pub fn add_array(&mut self, collection: impl Into<Collection<Index>>) -> bool

Add the array state to the type.

If the type already included this state, the function returns false.

Source

pub fn add_object(&mut self, collection: impl Into<Collection<Field>>) -> bool

Add the object state to the type.

If the type already included this state, the function returns false.

Source§

impl Kind

Source

pub fn remove_bytes(&mut self) -> bool

Remove the bytes state from the type.

If the type previously included this state, true is returned.

Source

pub fn remove_integer(&mut self) -> bool

Remove the integer state from the type.

If the type previously included this state, true is returned.

Source

pub fn remove_float(&mut self) -> bool

Remove the float state from the type.

If the type previously included this state, true is returned.

Source

pub fn remove_boolean(&mut self) -> bool

Remove the boolean state from the type.

If the type previously included this state, true is returned.

Source

pub fn remove_timestamp(&mut self) -> bool

Remove the timestamp state from the type.

If the type previously included this state, true is returned.

Source

pub fn remove_regex(&mut self) -> bool

Remove the regex state from the type.

If the type previously included this state, true is returned.

Source

pub fn remove_null(&mut self) -> bool

Remove the null state from the type.

If the type previously included this state, true is returned.

Source

pub fn remove_undefined(&mut self) -> bool

Remove the undefined state from the type.

If the type previously included this state, true is returned.

Source

pub fn remove_array(&mut self) -> bool

Remove the array state from the type.

If the type previously included this state, true is returned.

Source

pub fn remove_object(&mut self) -> bool

Remove the object state from the type.

If the type previously included this state, true is returned.

Source§

impl Kind

Source

pub fn without_undefined(&self) -> Self

Remove the undefined state from the type, and return it.

Source

pub fn without_array(&self) -> Self

Remove the array state from the type, and return it.

Source

pub fn without_object(&self) -> Self

Remove the object state from the type, and return it.

Source§

impl Kind

Source

pub const fn is_any(&self) -> bool

Returns true if all type states are valid.

That is, this method only returns true if the object matches all of the known types.

Source

pub const fn is_json(&self) -> bool

Returns true if the JSON type states are valid.

Source

pub const fn is_collection(&self) -> bool

Returns true if only collection type states are valid.

Source

pub const fn is_bytes(&self) -> bool

Returns true if the type is bytes.

Source

pub const fn is_integer(&self) -> bool

Returns true if the type is integer.

Source

pub const fn is_never(&self) -> bool

Returns true if the type is never.

Source

pub const fn is_float(&self) -> bool

Returns true if the type is float.

Source

pub const fn is_boolean(&self) -> bool

Returns true if the type is boolean.

Source

pub const fn is_timestamp(&self) -> bool

Returns true if the type is timestamp.

Source

pub const fn is_regex(&self) -> bool

Returns true if the type is regex.

Source

pub const fn is_null(&self) -> bool

Returns true if the type is null.

Source

pub const fn is_undefined(&self) -> bool

Returns true if the type is undefined.

Source

pub const fn is_array(&self) -> bool

Returns true if the type is array.

Source

pub const fn is_object(&self) -> bool

Returns true if the type is object.

Source

pub const fn is_exact(&self) -> bool

Returns true if at most one type is set.

Source

pub fn is_superset(&self, other: &Self) -> Result<(), OwnedValuePath>

Check if self is a superset of other.

Meaning, if other has a type defined as valid, then self needs to have it defined as valid as well.

Collection types are recursively checked (meaning, known fields in self also need to be a superset of other.

§Errors

If the type is not a superset, a path to one field that doesn’t match is returned. This is mostly useful for debugging.

Source

pub const fn intersects(&self, other: &Self) -> bool

Check if self intersects other.

Returns true if there are type states common to both self and other.

Source§

impl Kind

Source

pub const fn contains_bytes(&self) -> bool

Returns true if the type is at least bytes.

Source

pub const fn contains_integer(&self) -> bool

Returns true if the type is at least integer.

Source

pub const fn contains_float(&self) -> bool

Returns true if the type is at least float.

Source

pub const fn contains_boolean(&self) -> bool

Returns true if the type is at least boolean.

Source

pub const fn contains_timestamp(&self) -> bool

Returns true if the type is at least timestamp.

Source

pub const fn contains_regex(&self) -> bool

Returns true if the type is at least regex.

Source

pub const fn contains_null(&self) -> bool

Returns true if the type is at least null.

Source

pub const fn contains_undefined(&self) -> bool

Returns true if the type is at least undefined.

Source

pub const fn contains_any_defined(&self) -> bool

Returns true if the type can be any type other than undefined

Source

pub const fn contains_array(&self) -> bool

Returns true if the type is at least array.

Source

pub const fn contains_object(&self) -> bool

Returns true if the type is at least object.

Source

pub const fn contains_primitive(&self) -> bool

Returns true if the type contains at least one non-collection type.

Source§

impl Kind

Source

pub const fn as_object(&self) -> Option<&Collection<Field>>

Get the inner object collection.

This returns None if the type is not known to be an object.

Source

pub fn as_object_mut(&mut self) -> Option<&mut Collection<Field>>

Get a mutable reference to the inner object collection.

This returns None if the type is not known to be an object.

Source

pub fn into_object(self) -> Option<Collection<Field>>

Take an object Collection type out of the Kind.

This returns None if the type is not known to be an object.

Source

pub const fn as_array(&self) -> Option<&Collection<Index>>

Get the inner array collection.

This returns None if the type is not known to be an array.

Source

pub fn as_array_mut(&mut self) -> Option<&mut Collection<Index>>

Get a mutable reference to the inner array collection.

This returns None if the type is not known to be an array.

Source

pub fn into_array(self) -> Option<Collection<Index>>

Take an array Collection type out of the Kind.

This returns None if the type is not known to be an array.

Source

pub fn to_primitives(self) -> Self

Returns Kind, with non-primitive states removed.

That is, it returns self, but removes the object and array states.

Source

pub fn upgrade_undefined(self) -> Self

VRL has an interesting property where accessing an undefined value “upgrades” it to a “null” value. This should be used in places those implicit upgrades can occur.

Source§

impl Kind

Source

pub fn get<'a>(&self, path: impl ValuePath<'a>) -> Self

Returns the type of a value that is retrieved from a certain path.

This has the same behavior as Value::get, including the implicit conversion of “undefined” to “null.

If you want the type without the implicit type conversion, use Kind::at_path instead.

Source

pub fn at_path<'a>(&self, path: impl ValuePath<'a>) -> Self

This retrieves the Kind at a given path. There is a subtle difference between this and Kind::get where this function does not convert undefined to null. It is viewing the type of a value in-place, before it is retrieved.

Source§

impl Kind

Source

pub fn insert<'a>(&mut self, path: impl ValuePath<'a>, kind: Self)

Insert the Kind at the given path within self. This has the same behavior as Value::insert.

Source

pub fn set_at_path<'a>(&mut self, path: impl ValuePath<'a>, kind: Self)

Set the Kind at the given path within self. There is a subtle difference between this and Kind::insert where this function does not convert undefined to null.

Source

pub fn insert_recursive<'a, 'b>( &'a mut self, iter: impl Iterator<Item = BorrowedSegment<'b>> + Clone, kind: Self, )

Insert the Kind at the given path within self. This has the same behavior as Value::insert.

§Panics

Object/Array not present in self.

Source§

impl Kind

Source

pub fn remove(&mut self, path: &OwnedValuePath, prune: bool) -> Self

Removes the Kind at the given path within self. This has the same behavior as Value::remove.

Source§

impl Kind

Source

pub fn debug_info(&self) -> ObjectMap

Returns a tree representation of Kind, in a more human readable format. This is for debugging / development purposes only.

Source§

impl Kind

Source

pub fn merge(&mut self, other: Self, strategy: Strategy)

Merge other into self, using the provided Strategy.

Source

pub fn union(&self, other: Self) -> Self

Returns the union of self and other.

Source

pub fn merge_keep(&mut self, other: Self, overwrite: bool)

Merge other into self, optionally overwriting on conflicts.

Source§

impl Kind

Source

pub fn canonicalize(&self) -> Self

Returns a Kind type in a standard / simple representation.

Trait Implementations§

Source§

impl BitOr for Kind

Source§

type Output = Kind

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl Clone for Kind

Source§

fn clone(&self) -> Kind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Kind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DefaultValue for Kind

Source§

fn default_value(&self) -> Value

Returns the default Value for a given Kind. Read more
Source§

impl Display for Kind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Kind> for Unknown

Source§

fn from(kind: &Kind) -> Self

Converts to this type from the input type.
Source§

impl From<&Value> for Kind

Source§

fn from(value: &Value) -> Self

Converts to this type from the input type.
Source§

impl From<Collection<Field>> for Kind

Source§

fn from(collection: Collection<Field>) -> Self

Converts to this type from the input type.
Source§

impl From<Collection<Index>> for Kind

Source§

fn from(collection: Collection<Index>) -> Self

Converts to this type from the input type.
Source§

impl From<Kind> for TypeDef

Source§

fn from(kind: Kind) -> Self

Converts to this type from the input type.
Source§

impl From<Kind> for Unknown

Source§

fn from(kind: Kind) -> Self

Converts to this type from the input type.
Source§

impl From<TypeDef> for Kind

Source§

fn from(type_def: TypeDef) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for Kind

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Kind

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Kind

Source§

fn partial_cmp(&self, other: &Kind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for Kind

Auto Trait Implementations§

§

impl Freeze for Kind

§

impl RefUnwindSafe for Kind

§

impl Send for Kind

§

impl Sync for Kind

§

impl Unpin for Kind

§

impl UnwindSafe for Kind

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

§

type Error = <Target as OctetsFrom<Source>>::Error

§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
§

fn octets_into(self) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either [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,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either [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>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

fn if_supports_color<'a, Out, ApplyFn>( &'a self, stream: impl Into<Stream>, apply: ApplyFn, ) -> SupportsColorsDisplay<'a, Self, Out, ApplyFn>
where ApplyFn: Fn(&'a Self) -> Out,

Apply a given transformation function to all formatters if the given stream supports at least basic ANSI colors, allowing you to conditionally apply given styles/colors. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSendSync for T