pub enum Body {
Value(Value),
Ref(Ref),
Template(Vec<Part>),
Object(BTreeMap<String, Body>),
Array(Vec<Body>),
}Expand description
A message body (decision 417): JSON, with values filled in when a notification is queued.
Variants§
Value(Value)
A JSON value as it is.
Ref(Ref)
A placeholder’s value, keeping its JSON type.
Template(Vec<Part>)
A string of text parts and placeholders.
Object(BTreeMap<String, Body>)
An object of bodies.
Array(Vec<Body>)
An array of bodies.
Implementations§
Source§impl Body
impl Body
Sourcepub fn from_config(value: &Value) -> Result<Self, String>
pub fn from_config(value: &Value) -> Result<Self, String>
A body written in the server configuration: JSON whose strings may hold {name}
placeholders ({{ and }} for literal braces). A string that is exactly one
placeholder is a Body::Ref, keeping the value’s JSON type.
§Errors
A string with an unknown placeholder, an unclosed {, or a lone }; the message names
the string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Body
impl<'de> Deserialize<'de> for Body
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Body
Source§impl JsonSchema for Body
impl JsonSchema for Body
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Body
Auto Trait Implementations§
impl Freeze for Body
impl RefUnwindSafe for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl UnsafeUnpin for Body
impl UnwindSafe for Body
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