pub trait StoredObject: Sized {
type Key<'a>: Copy;
const BUCKET: Bucket;
// Required methods
fn encode_key(key: Self::Key<'_>) -> String;
fn serialize(&self) -> Result<Vec<u8>, BoxedError>;
fn deserialize(bytes: Vec<u8>) -> Result<Self, BoxedError>;
}
Expand description
Object that can be stored in an ObjectStore
.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn encode_key(key: Self::Key<'_>) -> String
fn encode_key(key: Self::Key<'_>) -> String
Encodes the object key to a string.
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.