Struct kinto_http::bucket::Bucket
[−]
[src]
pub struct Bucket { pub data: Option<Value>, pub permissions: Option<BucketPermissions>, pub client: KintoClient, pub id: String, pub timestamp: Option<u64>, }
Fields
data: Option<Value>
permissions: Option<BucketPermissions>
client: KintoClient
id: String
timestamp: Option<u64>
Methods
impl Bucket
[src]
fn new<'a>(client: KintoClient, id: &'a str) -> Self
Create a new bucket resource.
fn collection(self, id: &'static str) -> Collection
fn new_collection(&mut self) -> Result<Collection, KintoError>
Create a new empty collection with a generated id.
fn list_collections(&mut self) -> Result<Vec<String>, KintoError>
List the names of all available collections.
fn delete_collections(&mut self) -> Result<(), KintoError>
Delete all available collections.
fn list_collections_request(&mut self) -> GetCollection
Create a custom list collections request.
fn delete_collections_request(&mut self) -> DeleteCollection
Create a custom delete collections request.
fn create_collection_request(&mut self) -> CreateRecord
Create a custom create collection request.
Trait Implementations
impl Debug for Bucket
[src]
impl Clone for Bucket
[src]
fn clone(&self) -> Bucket
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Default for Bucket
[src]
impl Resource for Bucket
[src]
fn unwrap_response(&mut self, wrapper: ResponseWrapper)
Unwrap a request response and update the current object.
fn get_timestamp(&mut self) -> Option<u64>
Return the object version timestamp.
fn load_request(&mut self) -> GetRecord
Create a custom load request for the endpoint.
fn update_request(&mut self) -> UpdateRecord
Create a custom update request for the endpoint.
fn delete_request(&mut self) -> DeleteRecord
Create a custom delete request for the endpoint.
fn load(&mut self) -> Result<(), KintoError>
Load bucket by id if exists.
fn set(&mut self) -> Result<(), KintoError>
Set current object to the server (create or update).
fn create(&mut self) -> Result<(), KintoError>
Create if not exists the current object.
fn update(&mut self) -> Result<(), KintoError>
Update an existing object if exists with the current object.
fn delete(&mut self) -> Result<(), KintoError>
Delete the current object from the server if exists.
impl From<ResponseWrapper> for Bucket
[src]
fn from(wrapper: ResponseWrapper) -> Self
Performs the conversion.