Struct kinto_http::collection::Collection
[−]
[src]
pub struct Collection { pub data: Option<Value>, pub permissions: Option<CollectionPermissions>, pub client: KintoClient, pub bucket: Bucket, pub id: String, pub timestamp: Option<u64>, }
Fields
data: Option<Value>
permissions: Option<CollectionPermissions>
client: KintoClient
bucket: Bucket
id: String
timestamp: Option<u64>
Methods
impl Collection
[src]
fn new<'a>(client: KintoClient, bucket: Bucket, id: &'a str) -> Self
Create a new collection resource.
fn record(self, id: &'static str) -> Record
fn new_record(&mut self) -> Result<Record, KintoError>
Create a new empty record with a generated id.
fn list_records(&mut self) -> Result<Vec<String>, KintoError>
List the names of all available records.
fn delete_records(&mut self) -> Result<(), KintoError>
Delete all available records.
fn list_records_request(&mut self) -> GetCollection
fn delete_records_request(&mut self) -> DeleteCollection
fn create_record_request(&mut self) -> CreateRecord
Trait Implementations
impl Debug for Collection
[src]
impl Clone for Collection
[src]
fn clone(&self) -> Collection
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 Collection
[src]
fn default() -> Collection
Returns the "default value" for a type. Read more
impl Resource for Collection
[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 Collection
[src]
fn from(wrapper: ResponseWrapper) -> Self
Performs the conversion.