pub(crate) struct UserObject {
version: u8,
user_id: Id,
payload: Bytes,
object_id: Id,
}Expand description
Represents how an object stored for a user is stored in our object store
Fields§
§version: u8So that we can change the format in the future
user_id: IdThe user that uploaded this object
payload: BytesActual contents of the object
object_id: IdDigest of this object - not actually stored in the object itself, but cached here
Implementations§
Trait Implementations§
Source§impl ObjectDetails for UserObject
impl ObjectDetails for UserObject
const PREFIX: &str = "user-obj"
type Identifier = Id
fn object_id(&self) -> &Id
fn from_bytes(bytes: Bytes) -> Result<Self>
Source§fn to_put_payload(&self) -> Result<PutPayload>
fn to_put_payload(&self) -> Result<PutPayload>
Turn this object into one (or more)
bytes::Bytesfn path_for(id: &Self::Identifier) -> Path
Auto Trait Implementations§
impl !Freeze for UserObject
impl RefUnwindSafe for UserObject
impl Send for UserObject
impl Sync for UserObject
impl Unpin for UserObject
impl UnsafeUnpin for UserObject
impl UnwindSafe for UserObject
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more