#[non_exhaustive]pub struct StorageObject {
pub collection: String,
pub key: String,
pub owner: UserId,
pub value: Value,
pub version: ObjectVersion,
pub write: WriteAccess,
pub updated_at: UnixMillis,
}Expand description
A stored object with its value: GET /v1/storage/{collection}/{key} and batch reads.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.collection: StringThe collection.
key: StringThe key.
owner: UserIdThe owner.
value: ValueThe value.
version: ObjectVersionThe version.
write: WriteAccessWho may write it.
updated_at: UnixMillisWhen it was last written.
Implementations§
Source§impl StorageObject
impl StorageObject
Sourcepub fn new(
collection: impl Into<String>,
key: impl Into<String>,
owner: UserId,
value: Value,
version: ObjectVersion,
updated_at: UnixMillis,
) -> Self
pub fn new( collection: impl Into<String>, key: impl Into<String>, owner: UserId, value: Value, version: ObjectVersion, updated_at: UnixMillis, ) -> Self
An object (owner write access).
Sourcepub fn with_write(self, write: WriteAccess) -> Self
pub fn with_write(self, write: WriteAccess) -> Self
The same object with this write access.
Sourcepub fn value_as<T: DeserializeOwned>(&self) -> Result<T, Error>
pub fn value_as<T: DeserializeOwned>(&self) -> Result<T, Error>
The value decoded as T.
Sourcepub fn info(&self) -> StorageObjectInfo
pub fn info(&self) -> StorageObjectInfo
The listing entry for this object (no value).
Trait Implementations§
Source§impl Clone for StorageObject
impl Clone for StorageObject
Source§impl Debug for StorageObject
impl Debug for StorageObject
Source§impl<'de> Deserialize<'de> for StorageObject
impl<'de> Deserialize<'de> for StorageObject
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 PartialEq for StorageObject
impl PartialEq for StorageObject
Source§impl Serialize for StorageObject
impl Serialize for StorageObject
impl StructuralPartialEq for StorageObject
Auto Trait Implementations§
impl Freeze for StorageObject
impl RefUnwindSafe for StorageObject
impl Send for StorageObject
impl Sync for StorageObject
impl Unpin for StorageObject
impl UnsafeUnpin for StorageObject
impl UnwindSafe for StorageObject
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,
impl<T> ConditionalSend for Twhere
T: Send,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.