Struct garage_model::bucket_table::Bucket
source · pub struct Bucket {
pub id: Uuid,
pub state: Deletable<BucketParams>,
}
Expand description
A bucket is a collection of objects
Its parameters are not directly accessible as:
- It must be possible to merge paramaters, hence the use of a LWW CRDT.
- A bucket has 2 states, Present or Deleted and parameters make sense only if present.
Fields§
§id: Uuid
ID of the bucket
state: Deletable<BucketParams>
State, and configuration if not deleted, of the bucket
Implementations§
source§impl Bucket
impl Bucket
pub fn present(id: Uuid, params: BucketParams) -> Self
sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
Returns true if this represents a deleted bucket
sourcepub fn params(&self) -> Option<&BucketParams>
pub fn params(&self) -> Option<&BucketParams>
Returns an option representing the parameters (None if in deleted state)
sourcepub fn params_mut(&mut self) -> Option<&mut BucketParams>
pub fn params_mut(&mut self) -> Option<&mut BucketParams>
Mutable version of .params()
Return the list of authorized keys, when each was updated, and the permission associated to the key
pub fn aliases(&self) -> &[(String, u64, bool)]
pub fn local_aliases(&self) -> &[((String, String), u64, bool)]
Trait Implementations§
source§impl<'de> Deserialize<'de> for Bucket
impl<'de> Deserialize<'de> for Bucket
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 InitialFormat for Bucket
impl InitialFormat for Bucket
source§const VERSION_MARKER: &'static [u8] = b""
const VERSION_MARKER: &'static [u8] = b""
A sequence of bytes to add at the beginning of the serialized
string, to identify that the data is of this version.
source§impl PartialEq for Bucket
impl PartialEq for Bucket
impl Eq for Bucket
impl StructuralPartialEq for Bucket
Auto Trait Implementations§
impl Freeze for Bucket
impl RefUnwindSafe for Bucket
impl Send for Bucket
impl Sync for Bucket
impl Unpin for Bucket
impl UnwindSafe for Bucket
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.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> Migrate for Twhere
T: InitialFormat,
impl<T> Migrate for Twhere
T: InitialFormat,
source§const VERSION_MARKER: &'static [u8] = <T as InitialFormat>::VERSION_MARKER
const VERSION_MARKER: &'static [u8] = <T as InitialFormat>::VERSION_MARKER
A sequence of bytes to add at the beginning of the serialized
string, to identify that the data is of this version.
§type Previous = NoPrevious
type Previous = NoPrevious
The previous version of this data type, from which items of this version
can be migrated.
source§fn migrate(_previous: <T as Migrate>::Previous) -> T
fn migrate(_previous: <T as Migrate>::Previous) -> T
The migration function that transforms a value decoded in the old format
to an up-to-date value.