pub struct Doc {
pub owner: UserId,
pub data: Blob,
pub description: Option<String>,
pub created_at: Timestamp,
pub updated_at: Timestamp,
pub version: Option<Version>,
}
Expand description
Represents a document in a collection’s store.
This struct defines the structure of a document stored in a collection. It includes the following fields:
owner
: TheUserId
representing the owner of the document.data
: ABlob
containing the document’s data.description
: An optionalString
providing additional document description, limited to 1024 characters.created_at
: Au64
timestamp for the document’s creation.updated_at
: Au64
timestamp for the document’s last update.version
: Au64
number for the document’s version. The field is optional for backwards compatibility but, will be populated to 1 on the first create or update.
This struct is used to store and manage documents within a collection’s store.
Fields§
§owner: UserId
§data: Blob
§description: Option<String>
§created_at: Timestamp
§updated_at: Timestamp
§version: Option<Version>
Implementations§
Trait Implementations§
Source§impl CandidType for Doc
impl CandidType for Doc
Source§impl<'de> Deserialize<'de> for Doc
impl<'de> Deserialize<'de> for Doc
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 Storable for Doc
impl Storable for Doc
Source§fn from_bytes(bytes: Cow<'_, [u8]>) -> Self
fn from_bytes(bytes: Cow<'_, [u8]>) -> Self
Converts bytes into an element.
Source§fn to_bytes_checked(&self) -> Cow<'_, [u8]>
fn to_bytes_checked(&self) -> Cow<'_, [u8]>
Like
to_bytes
, but includes additional checks to ensure the element’s serialized bytes
are within the element’s bounds.Source§impl Timestamped for Doc
impl Timestamped for Doc
fn created_at(&self) -> Timestamp
fn updated_at(&self) -> Timestamp
fn cmp_updated_at(&self, other: &Self) -> Ordering
fn cmp_created_at(&self, other: &Self) -> Ordering
Auto Trait Implementations§
impl Freeze for Doc
impl RefUnwindSafe for Doc
impl Send for Doc
impl Sync for Doc
impl Unpin for Doc
impl UnwindSafe for Doc
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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