Struct ValuesMapBuilder
pub struct ValuesMapBuilder(/* private fields */);
Expand description
ValuesMapBuilder assists in building a ValuesMap.
Implementations§
§impl ValuesMapBuilder
impl ValuesMapBuilder
pub fn new() -> ValuesMapBuilder
pub fn new() -> ValuesMapBuilder
Returns a new empty ValuesMapBuilder.
pub fn try_from<S>(s: S) -> Result<ValuesMapBuilder, Error>where
S: Serialize,
pub fn try_from<S>(s: S) -> Result<ValuesMapBuilder, Error>where
S: Serialize,
Returns a ValuesMapBuilder populated from the given map-serializable value.
pub fn string(
&mut self,
key: impl Into<String>,
value: impl Into<String>,
) -> &mut ValuesMapBuilder
pub fn string( &mut self, key: impl Into<String>, value: impl Into<String>, ) -> &mut ValuesMapBuilder
Inserts a string value into the map.
pub fn string_option(
&mut self,
key: impl Into<String>,
value: Option<impl Into<String>>,
) -> &mut ValuesMapBuilder
pub fn string_option( &mut self, key: impl Into<String>, value: Option<impl Into<String>>, ) -> &mut ValuesMapBuilder
Inserts a string value into the map only if the given Option is Some.
pub fn string_array<T>(
&mut self,
key: impl Into<String>,
iter: impl IntoIterator<Item = T>,
) -> &mut ValuesMapBuilder
pub fn string_array<T>( &mut self, key: impl Into<String>, iter: impl IntoIterator<Item = T>, ) -> &mut ValuesMapBuilder
Inserts a string array into the map.
pub fn entry(
&mut self,
key: impl Into<String>,
value: impl Into<Value>,
) -> &mut ValuesMapBuilder
pub fn entry( &mut self, key: impl Into<String>, value: impl Into<Value>, ) -> &mut ValuesMapBuilder
Inserts an entry into the map using the value’s impl Into<Value>
.
pub fn serializable(
&mut self,
key: impl Into<String>,
value: impl Serialize,
) -> Result<&mut ValuesMapBuilder, Error>
pub fn serializable( &mut self, key: impl Into<String>, value: impl Serialize, ) -> Result<&mut ValuesMapBuilder, Error>
Inserts an entry into the map using the value’s impl Serialize
.
Trait Implementations§
§impl Default for ValuesMapBuilder
impl Default for ValuesMapBuilder
§fn default() -> ValuesMapBuilder
fn default() -> ValuesMapBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ValuesMapBuilder
impl RefUnwindSafe for ValuesMapBuilder
impl Send for ValuesMapBuilder
impl Sync for ValuesMapBuilder
impl Unpin for ValuesMapBuilder
impl UnwindSafe for ValuesMapBuilder
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more