pub struct Format(pub Cow<'static, str>);Expand description
A hint about the wire format of raw bytes.
Format is used to guide codecs when parsing Record::Raw bytes into
Value, or when serializing Value back to bytes.
This uses MIME-type-like strings for familiarity, but you can use any string that your codecs understand.
Tuple Fields§
§0: Cow<'static, str>Implementations§
Source§impl Format
impl Format
Sourcepub const VALUE_JSON: Format
pub const VALUE_JSON: Format
StructFS Value v1 tagged JSON (proposed media identifier).
Sourcepub const FLEXBUFFERS: Format
pub const FLEXBUFFERS: Format
FlexBuffers (application/x-flexbuffers; no registered MIME type)
Sourcepub const OCTET_STREAM: Format
pub const OCTET_STREAM: Format
Opaque binary data (application/octet-stream)
Sourcepub const VALUE: Format
pub const VALUE: Format
A parsed Value that was never serialized.
Used when a Record contains a Value that hasn’t been through a codec.
Sourcepub const fn from_static(s: &'static str) -> Format
pub const fn from_static(s: &'static str) -> Format
Create a format from a static string.
Sourcepub fn is_protobuf(&self) -> bool
pub fn is_protobuf(&self) -> bool
Check if this is protobuf format.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Format
impl<'de> Deserialize<'de> for Format
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Format, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Format, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Format
Source§impl Serialize for Format
impl Serialize for Format
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
impl UnwindSafe for Format
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