pub struct Request {
pub auth_adapter: Arc<dyn AuthAdapter>,
/* private fields */
}Fields§
§auth_adapter: Arc<dyn AuthAdapter>Implementations§
Source§impl Request
impl Request
pub fn new(auth_adapter: Arc<dyn AuthAdapter>) -> ClResult<Self>
pub async fn create_proxy_token( &self, tn_id: TnId, id_tag: &str, subject: Option<&str>, ) -> ClResult<Box<str>>
pub async fn get_bin( &self, tn_id: TnId, id_tag: &str, path: &str, auth: bool, ) -> ClResult<Bytes>
pub async fn get_stream( &self, tn_id: TnId, id_tag: &str, path: &str, ) -> ClResult<impl AsyncRead + Send + Unpin>
pub async fn get<Res>(
&self,
tn_id: TnId,
id_tag: &str,
path: &str,
) -> ClResult<Res>where
Res: DeserializeOwned,
pub async fn get_noauth<Res>(
&self,
tn_id: TnId,
id_tag: &str,
path: &str,
) -> ClResult<Res>where
Res: DeserializeOwned,
Sourcepub async fn get_public<Res>(&self, id_tag: &str, path: &str) -> ClResult<Res>where
Res: DeserializeOwned,
pub async fn get_public<Res>(&self, id_tag: &str, path: &str) -> ClResult<Res>where
Res: DeserializeOwned,
Make a public GET request without authentication or tenant context
Sourcepub async fn get_conditional<Res>(
&self,
id_tag: &str,
path: &str,
etag: Option<&str>,
) -> ClResult<ConditionalResult<Res>>where
Res: DeserializeOwned,
pub async fn get_conditional<Res>(
&self,
id_tag: &str,
path: &str,
etag: Option<&str>,
) -> ClResult<ConditionalResult<Res>>where
Res: DeserializeOwned,
Make a conditional GET request with If-None-Match header for etag support
Returns ConditionalResult::NotModified if server returns 304,
or ConditionalResult::Modified with data and new etag if content changed.
Sourcepub async fn post_public<Req, Res>(
&self,
id_tag: &str,
path: &str,
data: &Req,
) -> ClResult<Res>where
Req: Serialize,
Res: DeserializeOwned,
pub async fn post_public<Req, Res>(
&self,
id_tag: &str,
path: &str,
data: &Req,
) -> ClResult<Res>where
Req: Serialize,
Res: DeserializeOwned,
Make a public POST request without authentication or tenant context
pub async fn post_bin( &self, _tn_id: TnId, id_tag: &str, path: &str, data: Bytes, ) -> ClResult<Bytes>
pub async fn post_stream<S>( &self, _tn_id: TnId, id_tag: &str, path: &str, stream: S, ) -> ClResult<Bytes>
pub async fn post<Res>(
&self,
tn_id: TnId,
id_tag: &str,
path: &str,
data: &impl Serialize,
) -> ClResult<Res>where
Res: DeserializeOwned,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Request
impl !RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl !UnwindSafe for Request
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more