#[non_exhaustive]pub enum Mapping {
Nothing,
Send(Value),
Omit(&'static str),
Place,
Unsupported(String),
}Expand description
What a wire does with one option.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Nothing
The option is unset. For a set option this is an encode error.
Send(Value)
Deep-merge this JSON object into the body, above the wire’s own
encoding of the request and below additional_params.
Omit(&'static str)
Honour the option by sending nothing: the provider default already
does what was asked. Logged at debug with the reason.
Place
Honour the option through markers the wire’s base builder writes
inside the body’s arrays. Valid for cache only.
Unsupported(String)
The wire or model cannot honour it: an error under
OnUnsupported::Error, a warning
under OnUnsupported::Ignore.
Implementations§
Source§impl Mapping
impl Mapping
Sourcepub fn of<T>(value: Option<T>, map: impl FnOnce(T) -> Mapping) -> Mapping
pub fn of<T>(value: Option<T>, map: impl FnOnce(T) -> Mapping) -> Mapping
Nothing for an unset option, otherwise what map answers for it.
Sourcepub fn of_stop(
stop: &[String],
map: impl FnOnce(&[String]) -> Mapping,
) -> Mapping
pub fn of_stop( stop: &[String], map: impl FnOnce(&[String]) -> Mapping, ) -> Mapping
Nothing for an empty stop list, otherwise what map answers.
Sourcepub fn unsupported(reason: impl Into<String>) -> Mapping
pub fn unsupported(reason: impl Into<String>) -> Mapping
The refusal for reason. Answer it only for a set option, through
Mapping::of or Mapping::of_stop: an unset option answers
Mapping::Nothing.
Trait Implementations§
impl StructuralPartialEq for Mapping
Auto Trait Implementations§
impl Freeze for Mapping
impl RefUnwindSafe for Mapping
impl Send for Mapping
impl Sync for Mapping
impl Unpin for Mapping
impl UnsafeUnpin for Mapping
impl UnwindSafe for Mapping
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 more