Struct fiberplane_models::blobs::Blob
source · #[non_exhaustive]pub struct Blob {
pub data: Bytes,
pub mime_type: String,
}
Expand description
Binary blob for passing data in arbitrary encodings.
Binary blobs are both consumed and produced by providers. Note that for many use-cases, we use agreed on MIME types as defined in RFC 47. Providers are able to use custom MIME types if they desire.
We can also store blobs in cells, but for this we use EncodedBlob to allow JSON serialization.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.data: Bytes
Raw data.
mime_type: String
MIME type to use for interpreting the raw data.
We keep track of this, so that we can elide unnecessary calls to
extract_data()
, and are able to perform migrations on data specified
in any of the application/vnd.fiberplane.*
types. For other types of
data, providers are responsible for migrations, and they are able to
include version numbers in their MIME type strings, if desired.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Blob
impl<'de> Deserialize<'de> for Blob
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
source§impl From<&Blob> for EncodedBlob
impl From<&Blob> for EncodedBlob
source§impl From<Blob> for EncodedBlob
impl From<Blob> for EncodedBlob
source§impl PartialEq for Blob
impl PartialEq for Blob
source§impl TryFrom<&EncodedBlob> for Blob
impl TryFrom<&EncodedBlob> for Blob
§type Error = DecodeError
type Error = DecodeError
The type returned in the event of a conversion error.
source§impl TryFrom<EncodedBlob> for Blob
impl TryFrom<EncodedBlob> for Blob
§type Error = DecodeError
type Error = DecodeError
The type returned in the event of a conversion error.
impl Eq for Blob
impl StructuralPartialEq for Blob
Auto Trait Implementations§
impl !Freeze for Blob
impl RefUnwindSafe for Blob
impl Send for Blob
impl Sync for Blob
impl Unpin for Blob
impl UnwindSafe for Blob
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