Trait kinto_http::resource::Resource
[−]
[src]
pub trait Resource: Serialize + Deserialize + Clone { fn unwrap_response(&mut self, wrapper: ResponseWrapper); fn get_timestamp(&mut self) -> Option<u64>; fn load_request(&mut self) -> GetRecord; fn update_request(&mut self) -> UpdateRecord; fn delete_request(&mut self) -> DeleteRecord; fn load(&mut self) -> Result<(), KintoError> { ... } fn set(&mut self) -> Result<(), KintoError> { ... } fn create(&mut self) -> Result<(), KintoError> { ... } fn update(&mut self) -> Result<(), KintoError> { ... } fn delete(&mut self) -> Result<(), KintoError> { ... } }
Implement a Kinto core resource client.
Required Methods
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.
Provided Methods
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.
Implementors
impl Resource for Bucket
impl Resource for Collection
impl Resource for Record