pub struct ReductClient { /* private fields */ }
Expand description
ReductStore client.
Implementations§
Source§impl ReductClient
impl ReductClient
Sourcepub fn builder() -> ReductClientBuilder
pub fn builder() -> ReductClientBuilder
Create a new ReductClientBuilder.
§Examples
use reduct_rs::ReductClient;
let client = ReductClient::builder()
.set_url("https://reductstore.com")
.set_api_token("my-api-token")
.build();
Sourcepub async fn server_info(&self) -> Result<ServerInfo, ReductError>
pub async fn server_info(&self) -> Result<ServerInfo, ReductError>
Sourcepub async fn bucket_list(&self) -> Result<BucketInfoList, ReductError>
pub async fn bucket_list(&self) -> Result<BucketInfoList, ReductError>
Sourcepub fn create_bucket(&self, name: &str) -> BucketBuilder
pub fn create_bucket(&self, name: &str) -> BucketBuilder
Sourcepub async fn get_bucket(&self, name: &str) -> Result<Bucket, ReductError>
pub async fn get_bucket(&self, name: &str) -> Result<Bucket, ReductError>
Sourcepub async fn alive(&self) -> Result<(), ReductError>
pub async fn alive(&self) -> Result<(), ReductError>
Sourcepub async fn me(&self) -> Result<Token, ReductError>
pub async fn me(&self) -> Result<Token, ReductError>
Sourcepub async fn create_token(
&self,
name: &str,
permissions: Permissions,
) -> Result<String, ReductError>
pub async fn create_token( &self, name: &str, permissions: Permissions, ) -> Result<String, ReductError>
Sourcepub async fn delete_token(&self, name: &str) -> Result<(), ReductError>
pub async fn delete_token(&self, name: &str) -> Result<(), ReductError>
Sourcepub async fn list_tokens(&self) -> Result<Vec<Token>, ReductError>
pub async fn list_tokens(&self) -> Result<Vec<Token>, ReductError>
Sourcepub async fn list_replications(
&self,
) -> Result<Vec<ReplicationInfo>, ReductError>
pub async fn list_replications( &self, ) -> Result<Vec<ReplicationInfo>, ReductError>
Sourcepub async fn get_replication(
&self,
name: &str,
) -> Result<FullReplicationInfo, ReductError>
pub async fn get_replication( &self, name: &str, ) -> Result<FullReplicationInfo, ReductError>
Sourcepub fn create_replication(&self, name: &str) -> ReplicationBuilder
pub fn create_replication(&self, name: &str) -> ReplicationBuilder
Create a replication
§Arguments
name
- The name of the replication
§Returns
a replication builder to set the replication settings
§Example
use reduct_rs::ReductClient;
#[tokio::main]
async fn main() {
let client = ReductClient::builder()
.url("http://127.0.0.1:8383")
.api_token("my-api-token")
.build();
client.create_replication("test-replication")
.src_bucket("test-bucket-1")
.dst_bucket("test-bucket-2")
.dst_host("https://play.reduct.store")
.dst_token("reductstore")
.send()
.await
.unwrap();
}
Sourcepub async fn update_replication(
&self,
name: &str,
settings: ReplicationSettings,
) -> Result<(), ReductError>
pub async fn update_replication( &self, name: &str, settings: ReplicationSettings, ) -> Result<(), ReductError>
Sourcepub async fn delete_replication(&self, name: &str) -> Result<(), ReductError>
pub async fn delete_replication(&self, name: &str) -> Result<(), ReductError>
Auto Trait Implementations§
impl Freeze for ReductClient
impl !RefUnwindSafe for ReductClient
impl Send for ReductClient
impl Sync for ReductClient
impl Unpin for ReductClient
impl !UnwindSafe for ReductClient
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