Struct garage_model::helper::bucket::BucketHelper
source · [−]pub struct BucketHelper<'a>(_);
Implementations
pub async fn resolve_global_bucket_name(
&self,
bucket_name: &String
) -> Result<Option<Uuid>, Error>
Returns a Bucket if it is present in bucket table, even if it is in deleted state. Querying a non-existing bucket ID returns an internal error.
Returns a Bucket if it is present in bucket table, only if it is in non-deleted state. Querying a non-existing bucket ID or a deleted bucket returns a bad request error.
Returns a Key if it is present in key table, even if it is in deleted state. Querying a non-existing key ID returns an internal error.
Returns a Key if it is present in key table, only if it is in non-deleted state. Querying a non-existing key ID or a deleted key returns a bad request error.
Returns a Key if it is present in key table, looking it up by key ID or by a match on its name, only if it is in non-deleted state. Querying a non-existing key ID or a deleted key returns a bad request error.
Sets a new alias for a bucket in global namespace. This function fails if:
- alias name is not valid according to S3 spec
- bucket does not exist or is deleted
- alias already exists and points to another bucket
Unsets an alias for a bucket in global namespace. This function fails if:
- bucket does not exist or is deleted
- alias does not exist or maps to another bucket (-> internal error)
- bucket has no other aliases (global or local)
Ensures a bucket does not have a certain global alias. Contrarily to unset_global_bucket_alias, this does not fail on any condition other than:
- bucket cannot be found (its fine if it is in deleted state)
- alias cannot be found (its fine if it points to nothing or to another bucket)
Sets a new alias for a bucket in the local namespace of a key. This function fails if:
- alias name is not valid according to S3 spec
- bucket does not exist or is deleted
- key does not exist or is deleted
- alias already exists and points to another bucket
Unsets an alias for a bucket in the local namespace of a key. This function fails if:
- bucket does not exist or is deleted
- key does not exist or is deleted
- alias does not exist or maps to another bucket (-> internal error)
- bucket has no other aliases (global or local)
pub async fn set_bucket_key_permissions(
&self,
bucket_id: Uuid,
key_id: &String,
perm: BucketKeyPerm
) -> Result<(), Error>
pub async fn set_bucket_key_permissions(
&self,
bucket_id: Uuid,
key_id: &String,
perm: BucketKeyPerm
) -> Result<(), Error>
Sets permissions for a key on a bucket. This function fails if:
- bucket or key cannot be found at all (its ok if they are in deleted state)
- bucket or key is in deleted state and we are trying to set permissions other than “deny all”
Auto Trait Implementations
impl<'a> !RefUnwindSafe for BucketHelper<'a>
impl<'a> Send for BucketHelper<'a>
impl<'a> Sync for BucketHelper<'a>
impl<'a> Unpin for BucketHelper<'a>
impl<'a> !UnwindSafe for BucketHelper<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more