pub struct K2DbApiClient { /* private fields */ }Implementations§
Source§impl K2DbApiClient
impl K2DbApiClient
pub fn new(options: K2DbApiClientOptions) -> Result<Self, K2DbApiClientError>
pub async fn health(&self) -> Result<HealthOk, K2DbApiClientError>
pub async fn ready( &self, ) -> Result<Result<ReadyOk, ReadyNotOk>, K2DbApiClientError>
pub async fn create<T: Serialize>( &self, collection: &str, document: &T, options: &RequestOptions, ) -> Result<CreateResult, K2DbApiClientError>
pub async fn get_by_id<T: DeserializeOwned>( &self, collection: &str, id: &str, options: &RequestOptions, ) -> Result<T, K2DbApiClientError>
pub async fn patch_by_id<T: Serialize>( &self, collection: &str, id: &str, document: &T, options: &RequestOptions, ) -> Result<UpdateResult, K2DbApiClientError>
pub async fn delete_by_id( &self, collection: &str, id: &str, options: &RequestOptions, ) -> Result<(), K2DbApiClientError>
pub async fn patch_collection( &self, collection: &str, payload: &PatchCollectionRequest, options: &RequestOptions, ) -> Result<UpdateResult, K2DbApiClientError>
pub async fn search<T: DeserializeOwned>( &self, collection: &str, payload: &SearchRequest, options: &RequestOptions, ) -> Result<Vec<T>, K2DbApiClientError>
pub async fn aggregate<T: DeserializeOwned>( &self, collection: &str, payload: &AggregateRequest, options: &RequestOptions, ) -> Result<Vec<T>, K2DbApiClientError>
pub async fn count( &self, collection: &str, payload: &CountRequest, options: &RequestOptions, ) -> Result<CountResult, K2DbApiClientError>
pub async fn restore( &self, collection: &str, payload: &RestoreRequest, options: &RequestOptions, ) -> Result<RestoreResult, K2DbApiClientError>
pub async fn get_versions( &self, collection: &str, id: &str, skip: Option<u64>, limit: Option<u64>, options: &RequestOptions, ) -> Result<Vec<VersionInfo>, K2DbApiClientError>
pub async fn patch_versions( &self, collection: &str, id: &str, payload: &VersionedUpdateRequest, options: &RequestOptions, ) -> Result<Vec<VersionedUpdateResult>, K2DbApiClientError>
pub async fn revert_version( &self, collection: &str, id: &str, version: u64, options: &RequestOptions, ) -> Result<UpdateResult, K2DbApiClientError>
pub async fn admin_delete_collection( &self, collection: &str, options: &RequestOptions, ) -> Result<(), K2DbApiClientError>
pub async fn admin_delete_by_id( &self, collection: &str, id: &str, options: &RequestOptions, ) -> Result<(), K2DbApiClientError>
pub async fn admin_create_indexes( &self, collection: &str, payload: &CreateIndexesRequest, options: &RequestOptions, ) -> Result<MessageResponse, K2DbApiClientError>
pub async fn admin_create_history_indexes( &self, collection: &str, options: &RequestOptions, ) -> Result<MessageResponse, K2DbApiClientError>
Trait Implementations§
Source§impl Clone for K2DbApiClient
impl Clone for K2DbApiClient
Source§fn clone(&self) -> K2DbApiClient
fn clone(&self) -> K2DbApiClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for K2DbApiClient
impl !RefUnwindSafe for K2DbApiClient
impl Send for K2DbApiClient
impl Sync for K2DbApiClient
impl Unpin for K2DbApiClient
impl UnsafeUnpin for K2DbApiClient
impl !UnwindSafe for K2DbApiClient
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