pub struct AzureSearchClient { /* private fields */ }Expand description
Azure Search API client
Implementations§
Source§impl AzureSearchClient
impl AzureSearchClient
Sourcepub fn from_service_config(
service: &SearchServiceConfig,
) -> Result<Self, ClientError>
pub fn from_service_config( service: &SearchServiceConfig, ) -> Result<Self, ClientError>
Create client from a specific search service config
Sourcepub fn with_auth(
base_url: String,
preview_api_version: String,
auth: Box<dyn AuthProvider>,
) -> Result<Self, ClientError>
pub fn with_auth( base_url: String, preview_api_version: String, auth: Box<dyn AuthProvider>, ) -> Result<Self, ClientError>
Create with a custom auth provider (for testing)
Sourcepub async fn list(&self, kind: ResourceKind) -> Result<Vec<Value>, ClientError>
pub async fn list(&self, kind: ResourceKind) -> Result<Vec<Value>, ClientError>
List all resources of a given kind
Sourcepub async fn get(
&self,
kind: ResourceKind,
name: &str,
) -> Result<Value, ClientError>
pub async fn get( &self, kind: ResourceKind, name: &str, ) -> Result<Value, ClientError>
Get a specific resource
Sourcepub async fn create_or_update(
&self,
kind: ResourceKind,
name: &str,
definition: &Value,
) -> Result<Option<Value>, ClientError>
pub async fn create_or_update( &self, kind: ResourceKind, name: &str, definition: &Value, ) -> Result<Option<Value>, ClientError>
Create or update a resource
Returns the response body if the API returns one. Some APIs (especially
preview endpoints like Knowledge Sources) return 204 No Content on
successful update, which yields Ok(None).
Sourcepub async fn delete(
&self,
kind: ResourceKind,
name: &str,
) -> Result<(), ClientError>
pub async fn delete( &self, kind: ResourceKind, name: &str, ) -> Result<(), ClientError>
Delete a resource
Sourcepub async fn exists(
&self,
kind: ResourceKind,
name: &str,
) -> Result<bool, ClientError>
pub async fn exists( &self, kind: ResourceKind, name: &str, ) -> Result<bool, ClientError>
Check if a resource exists
Sourcepub fn auth_method(&self) -> &'static str
pub fn auth_method(&self) -> &'static str
Get the authentication method being used
Auto Trait Implementations§
impl Freeze for AzureSearchClient
impl !RefUnwindSafe for AzureSearchClient
impl Send for AzureSearchClient
impl Sync for AzureSearchClient
impl Unpin for AzureSearchClient
impl UnsafeUnpin for AzureSearchClient
impl !UnwindSafe for AzureSearchClient
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