Struct garage_model::s3::object_table::Object
source · pub struct Object {
pub bucket_id: Uuid,
pub key: String,
/* private fields */
}
Expand description
An object
Fields§
§bucket_id: Uuid
The bucket in which the object is stored, used as partition key
key: String
The key at which the object is stored in its bucket, used as sorting key
Implementations§
source§impl Object
impl Object
sourcepub fn new(bucket_id: Uuid, key: String, versions: Vec<ObjectVersion>) -> Self
pub fn new(bucket_id: Uuid, key: String, versions: Vec<ObjectVersion>) -> Self
Initialize an Object struct from parts
sourcepub fn add_version(&mut self, new: ObjectVersion) -> Result<(), ()>
pub fn add_version(&mut self, new: ObjectVersion) -> Result<(), ()>
Adds a version if it wasn’t already present
sourcepub fn versions(&self) -> &[ObjectVersion]
pub fn versions(&self) -> &[ObjectVersion]
Get a list of currently stored versions of Object
Trait Implementations§
source§impl CountedItem for Object
impl CountedItem for Object
source§impl<'de> Deserialize<'de> for Object
impl<'de> Deserialize<'de> for Object
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 Migrate for Object
impl Migrate for Object
source§const VERSION_MARKER: &'static [u8] = b"G010s3ob"
const VERSION_MARKER: &'static [u8] = b"G010s3ob"
A sequence of bytes to add at the beginning of the serialized
string, to identify that the data is of this version.
§type Previous = Object
type Previous = Object
The previous version of this data type, from which items of this version
can be migrated.
source§fn migrate(old: Object) -> Object
fn migrate(old: Object) -> Object
The migration function that transforms a value decoded in the old format
to an up-to-date value.
source§impl PartialEq for Object
impl PartialEq for Object
impl Eq for Object
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl Freeze for Object
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnwindSafe for Object
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.