pub struct EnterpriseClient { /* private fields */ }
Expand description
REST API client for Redis Enterprise
Implementations§
Source§impl EnterpriseClient
impl EnterpriseClient
Sourcepub fn builder() -> EnterpriseClientBuilder
pub fn builder() -> EnterpriseClientBuilder
Create a new builder for the client
Sourcepub fn client(&self) -> Arc<Client>
pub fn client(&self) -> Arc<Client>
Get a reference to the underlying client (for use with handlers)
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Create a client from environment variables
Reads configuration from:
REDIS_ENTERPRISE_URL
: Base URL for the cluster (default: “https://localhost:9443”)REDIS_ENTERPRISE_USER
: Username for authentication (default: “admin@redis.local”)REDIS_ENTERPRISE_PASSWORD
: Password for authentication (required)REDIS_ENTERPRISE_INSECURE
: Set to “true” to skip SSL verification (default: “false”)
Sourcepub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T>
pub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T>
Make a GET request
Sourcepub async fn get_binary(&self, path: &str) -> Result<Vec<u8>>
pub async fn get_binary(&self, path: &str) -> Result<Vec<u8>>
Make a GET request for binary content (e.g., tar.gz files)
Sourcepub async fn post<B: Serialize, T: DeserializeOwned>(
&self,
path: &str,
body: &B,
) -> Result<T>
pub async fn post<B: Serialize, T: DeserializeOwned>( &self, path: &str, body: &B, ) -> Result<T>
Make a POST request
Sourcepub async fn put<B: Serialize, T: DeserializeOwned>(
&self,
path: &str,
body: &B,
) -> Result<T>
pub async fn put<B: Serialize, T: DeserializeOwned>( &self, path: &str, body: &B, ) -> Result<T>
Make a PUT request
Sourcepub async fn get_raw(&self, path: &str) -> Result<Value>
pub async fn get_raw(&self, path: &str) -> Result<Value>
Execute raw GET request returning JSON Value
Sourcepub async fn post_raw(&self, path: &str, body: Value) -> Result<Value>
pub async fn post_raw(&self, path: &str, body: Value) -> Result<Value>
Execute raw POST request with JSON body
Sourcepub async fn put_raw(&self, path: &str, body: Value) -> Result<Value>
pub async fn put_raw(&self, path: &str, body: Value) -> Result<Value>
Execute raw PUT request with JSON body
Sourcepub async fn post_action<B: Serialize>(
&self,
path: &str,
body: &B,
) -> Result<()>
pub async fn post_action<B: Serialize>( &self, path: &str, body: &B, ) -> Result<()>
POST request for actions that return no content
Sourcepub async fn post_multipart<T: DeserializeOwned>(
&self,
path: &str,
file_data: Vec<u8>,
field_name: &str,
file_name: &str,
) -> Result<T>
pub async fn post_multipart<T: DeserializeOwned>( &self, path: &str, file_data: Vec<u8>, field_name: &str, file_name: &str, ) -> Result<T>
POST request with multipart/form-data for file uploads
Sourcepub fn rest_client(&self) -> Self
pub fn rest_client(&self) -> Self
Get a reference to self for handler construction
Sourcepub async fn post_bootstrap<B: Serialize>(
&self,
path: &str,
body: &B,
) -> Result<Value>
pub async fn post_bootstrap<B: Serialize>( &self, path: &str, body: &B, ) -> Result<Value>
POST request for bootstrap - handles empty response
Sourcepub async fn patch_raw(&self, path: &str, body: Value) -> Result<Value>
pub async fn patch_raw(&self, path: &str, body: Value) -> Result<Value>
Execute raw PATCH request with JSON body
Sourcepub async fn delete_raw(&self, path: &str) -> Result<Value>
pub async fn delete_raw(&self, path: &str) -> Result<Value>
Execute raw DELETE request returning any response body
Trait Implementations§
Source§impl Clone for EnterpriseClient
impl Clone for EnterpriseClient
Source§fn clone(&self) -> EnterpriseClient
fn clone(&self) -> EnterpriseClient
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 EnterpriseClient
impl !RefUnwindSafe for EnterpriseClient
impl Send for EnterpriseClient
impl Sync for EnterpriseClient
impl Unpin for EnterpriseClient
impl !UnwindSafe for EnterpriseClient
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