value_bag::fill

Struct Slot

source
pub struct Slot<'s, 'f> { /* private fields */ }
Expand description

A value slot to fill using the Fill trait.

Implementations§

source§

impl<'s, 'f> Slot<'s, 'f>

source

pub fn fill_any<T>(self, value: T) -> Result<(), Error>
where T: Into<ValueBag<'f>>,

Fill the slot with a value.

The given value doesn’t need to satisfy any particular lifetime constraints.

source§

impl<'s, 'f> Slot<'s, 'f>

source

pub fn fill_error<T>(self, value: T) -> Result<(), Error>
where T: Error + 'static,

Fill the slot with an error.

The given value doesn’t need to satisfy any particular lifetime constraints.

source

pub fn fill_dyn_error(self, value: &(dyn Error + 'static)) -> Result<(), Error>

Fill the slot with an error.

source§

impl<'s, 'f> Slot<'s, 'f>

source

pub fn fill_debug<T>(self, value: T) -> Result<(), Error>
where T: Debug,

Fill the slot with a debuggable value.

The given value doesn’t need to satisfy any particular lifetime constraints.

source

pub fn fill_display<T>(self, value: T) -> Result<(), Error>
where T: Display,

Fill the slot with a displayable value.

The given value doesn’t need to satisfy any particular lifetime constraints.

source§

impl<'s, 'f> Slot<'s, 'f>

source

pub fn fill_seq_slice<I, T>(self, value: &'f I) -> Result<(), Error>
where I: AsRef<[T]>, &'f T: Into<ValueBag<'f>> + 'f,

Fill the slot with a sequence of values.

The given value doesn’t need to satisfy any particular lifetime constraints.

source§

impl<'s, 'f> Slot<'s, 'f>

source

pub fn fill_serde1<T>(self, value: T) -> Result<(), Error>
where T: Serialize,

Fill the slot with a structured value.

The given value doesn’t need to satisfy any particular lifetime constraints.

source§

impl<'s, 'f> Slot<'s, 'f>

source

pub fn fill_sval2<T>(self, value: T) -> Result<(), Error>
where T: Value,

Fill the slot with a structured value.

The given value doesn’t need to satisfy any particular lifetime constraints.

Trait Implementations§

source§

impl<'s, 'f> Debug for Slot<'s, 'f>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'s, 'f> Freeze for Slot<'s, 'f>

§

impl<'s, 'f> !RefUnwindSafe for Slot<'s, 'f>

§

impl<'s, 'f> !Send for Slot<'s, 'f>

§

impl<'s, 'f> !Sync for Slot<'s, 'f>

§

impl<'s, 'f> Unpin for Slot<'s, 'f>

§

impl<'s, 'f> !UnwindSafe for Slot<'s, 'f>

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

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.