Struct cloud_storage::client::Client
source · [−]pub struct Client { /* private fields */ }
Expand description
The primary entrypoint to perform operations with Google Cloud Storage.
Implementations
sourceimpl Client
impl Client
sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a client with the default token provider, where it attemps to obtain the credentials from the following locations:
- Checks for the environment variable
SERVICE_ACCOUNT
, and if it exists, reads the file at the path specified there as a credentials json file. - It attemps to do the same with the
GOOGLE_APPLICATION_CREDENTIALS
var. - It reads the
SERVICE_ACCOUNT_JSON
environment variable directly as json and uses that - It attemps to do the same with the
GOOGLE_APPLICATION_CREDENTIALS_JSON
var.
sourcepub fn with_cache(token: impl TokenCache + Send + 'static) -> Self
pub fn with_cache(token: impl TokenCache + Send + 'static) -> Self
Initializer with a provided refreshable token
sourcepub fn bucket(&self) -> BucketClient<'_>
pub fn bucket(&self) -> BucketClient<'_>
Operations on Bucket
s.
sourcepub fn bucket_access_control(&self) -> BucketAccessControlClient<'_>
pub fn bucket_access_control(&self) -> BucketAccessControlClient<'_>
Operations on BucketAccessControl
s.
sourcepub fn default_object_access_control(
&self
) -> DefaultObjectAccessControlClient<'_>
pub fn default_object_access_control(
&self
) -> DefaultObjectAccessControlClient<'_>
Operations on DefaultObjectAccessControl
s.
sourcepub fn hmac_key(&self) -> HmacKeyClient<'_>
pub fn hmac_key(&self) -> HmacKeyClient<'_>
Operations on HmacKey
s.
sourcepub fn object(&self) -> ObjectClient<'_>
pub fn object(&self) -> ObjectClient<'_>
Operations on Object
s.
sourcepub fn object_access_control(&self) -> ObjectAccessControlClient<'_>
pub fn object_access_control(&self) -> ObjectAccessControlClient<'_>
Operations on ObjectAccessControl
s.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more