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: TheUserIdrepresenting the owner of the document.data: ABlobcontaining the document’s data.description: An optionalStringproviding additional document description, limited to 1024 characters.created_at: Au64timestamp for the document’s creation.updated_at: Au64timestamp for the document’s last update.version: Au64number 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 to_bytes(&self) -> Cow<'_, [u8]>
fn to_bytes(&self) -> Cow<'_, [u8]>
Converts the element into a possibly borrowed byte slice. Read more
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 checks that bytes conform to declared bounds.Source§fn into_bytes_checked(self) -> Vec<u8> ⓘwhere
Self: Sized,
fn into_bytes_checked(self) -> Vec<u8> ⓘwhere
Self: Sized,
Like
into_bytes, but checks that bytes conform to declared bounds.Source§fn check_bounds(bytes: &[u8])
fn check_bounds(bytes: &[u8])
Validates that a byte slice fits within this type’s declared 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