pub trait ObjectDetails: Sized {
type Identifier: Display;
const PREFIX: &'static str;
// Required methods
fn object_id(&self) -> &Self::Identifier;
fn from_bytes(bytes: Bytes) -> Result<Self>;
fn to_put_payload(&self) -> Result<PutPayload>;
// Provided method
fn path_for(id: &Self::Identifier) -> Path { ... }
}Expand description
Details on how to store this type in the object store.
You probably want to implement this trait via JsonObjectDetails.
Required Associated Constants§
Required Associated Types§
type Identifier: Display
Required Methods§
fn object_id(&self) -> &Self::Identifier
fn from_bytes(bytes: Bytes) -> Result<Self>
Sourcefn to_put_payload(&self) -> Result<PutPayload>
fn to_put_payload(&self) -> Result<PutPayload>
Turn this object into one (or more) bytes::Bytes
Provided Methods§
fn path_for(id: &Self::Identifier) -> Path
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.