pub enum Payload {
None,
Text(String),
Bytes(Vec<u8>),
Json(Value),
}Expand description
Carga útil da ação (payload).
Paper I §3.1: o payload deve ser JSON estrito validado por schema do verbo.
Em v0.1.0, suporta None, Text, Bytes e Json (com feature serde).
§Exemplo
use logline_core::Payload;
let none = Payload::None;
let text = Payload::Text("Hello".into());
let bytes = Payload::Bytes(vec![1, 2, 3]);
assert_eq!(none.kind(), "none");
assert_eq!(text.kind(), "text");
assert_eq!(bytes.kind(), "bytes");Variants§
None
Sem payload.
Text(String)
Payload como string de texto.
Bytes(Vec<u8>)
Payload como bytes brutos.
Json(Value)
Available on crate feature
serde only.JSON estrito validado por schema do verbo (Paper I §3.1).
Disponível apenas com feature serde.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Payload
impl<'de> Deserialize<'de> for Payload
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 StructuralPartialEq for Payload
Auto Trait Implementations§
impl Freeze for Payload
impl RefUnwindSafe for Payload
impl Send for Payload
impl Sync for Payload
impl Unpin for Payload
impl UnwindSafe for Payload
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