pub struct OpenFgaServiceClient<T> { /* private fields */ }Implementations§
Source§impl<T> OpenFgaServiceClient<T>where
T: GrpcService<Body> + Clone,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> OpenFgaServiceClient<T>where
T: GrpcService<Body> + Clone,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
Sourcepub fn into_client(
self,
store_id: &str,
authorization_model_id: &str,
) -> OpenFgaClient<T>
pub fn into_client( self, store_id: &str, authorization_model_id: &str, ) -> OpenFgaClient<T>
Transform this service client into a higher-level OpenFgaClient.
Sourcepub async fn get_store_by_name(
&mut self,
store_name: &str,
) -> Result<Option<Store>>
pub async fn get_store_by_name( &mut self, store_name: &str, ) -> Result<Option<Store>>
Fetch a store by name.
If no store is found, returns Ok(None).
§Errors
Error::AmbiguousStoreNameif multiple stores with the same name are found.Error::RequestFailedif the request to OpenFGA fails.
Sourcepub async fn get_or_create_store(&mut self, store_name: &str) -> Result<Store>
pub async fn get_or_create_store(&mut self, store_name: &str) -> Result<Store>
Get a store by name or create it if it doesn’t exist. Returns information about the store, including its ID.
§Errors
Error::RequestFailedIf a request to OpenFGA fails.Error::AmbiguousStoreNameIf multiple stores with the same name are found.
Sourcepub async fn read_all_pages(
&mut self,
store_id: &str,
tuple: Option<impl Into<ReadRequestTupleKey>>,
consistency: impl Into<ConsistencyPreference>,
page_size: i32,
max_pages: u32,
) -> Result<Vec<Tuple>>
pub async fn read_all_pages( &mut self, store_id: &str, tuple: Option<impl Into<ReadRequestTupleKey>>, consistency: impl Into<ConsistencyPreference>, page_size: i32, max_pages: u32, ) -> Result<Vec<Tuple>>
Wrapper around Self::read that reads all pages of the result, handling pagination.
§Errors
Error::RequestFailedIf a request to OpenFGA fails.Error::TooManyPagesIf the number of pages read exceedsmax_pages.
Source§impl<T> OpenFgaServiceClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> OpenFgaServiceClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> OpenFgaServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>,
<T as Service<Request<Body>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
pub async fn read( &mut self, request: impl IntoRequest<ReadRequest>, ) -> Result<Response<ReadResponse>, Status>
pub async fn write( &mut self, request: impl IntoRequest<WriteRequest>, ) -> Result<Response<WriteResponse>, Status>
pub async fn check( &mut self, request: impl IntoRequest<CheckRequest>, ) -> Result<Response<CheckResponse>, Status>
pub async fn batch_check( &mut self, request: impl IntoRequest<BatchCheckRequest>, ) -> Result<Response<BatchCheckResponse>, Status>
pub async fn expand( &mut self, request: impl IntoRequest<ExpandRequest>, ) -> Result<Response<ExpandResponse>, Status>
pub async fn write_assertions( &mut self, request: impl IntoRequest<WriteAssertionsRequest>, ) -> Result<Response<WriteAssertionsResponse>, Status>
pub async fn read_assertions( &mut self, request: impl IntoRequest<ReadAssertionsRequest>, ) -> Result<Response<ReadAssertionsResponse>, Status>
pub async fn read_changes( &mut self, request: impl IntoRequest<ReadChangesRequest>, ) -> Result<Response<ReadChangesResponse>, Status>
pub async fn create_store( &mut self, request: impl IntoRequest<CreateStoreRequest>, ) -> Result<Response<CreateStoreResponse>, Status>
pub async fn update_store( &mut self, request: impl IntoRequest<UpdateStoreRequest>, ) -> Result<Response<UpdateStoreResponse>, Status>
pub async fn delete_store( &mut self, request: impl IntoRequest<DeleteStoreRequest>, ) -> Result<Response<DeleteStoreResponse>, Status>
pub async fn get_store( &mut self, request: impl IntoRequest<GetStoreRequest>, ) -> Result<Response<GetStoreResponse>, Status>
pub async fn list_stores( &mut self, request: impl IntoRequest<ListStoresRequest>, ) -> Result<Response<ListStoresResponse>, Status>
pub async fn streamed_list_objects( &mut self, request: impl IntoRequest<StreamedListObjectsRequest>, ) -> Result<Response<Streaming<StreamedListObjectsResponse>>, Status>
pub async fn list_objects( &mut self, request: impl IntoRequest<ListObjectsRequest>, ) -> Result<Response<ListObjectsResponse>, Status>
pub async fn list_users( &mut self, request: impl IntoRequest<ListUsersRequest>, ) -> Result<Response<ListUsersResponse>, Status>
Trait Implementations§
Source§impl<T: Clone> Clone for OpenFgaServiceClient<T>
impl<T: Clone> Clone for OpenFgaServiceClient<T>
Source§fn clone(&self) -> OpenFgaServiceClient<T>
fn clone(&self) -> OpenFgaServiceClient<T>
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<T> !Freeze for OpenFgaServiceClient<T>
impl<T> RefUnwindSafe for OpenFgaServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for OpenFgaServiceClient<T>where
T: Send,
impl<T> Sync for OpenFgaServiceClient<T>where
T: Sync,
impl<T> Unpin for OpenFgaServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for OpenFgaServiceClient<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request