pub struct GrpcReplicaFactory { /* private fields */ }Expand description
Reusable Google Storage v2 channel, authentication handle, and zonal routing token for one Rapid bucket.
Implementations§
Source§impl GrpcReplicaFactory
impl GrpcReplicaFactory
Sourcepub async fn connect(
zone: usize,
endpoint: &str,
bucket: impl Into<String>,
bearer_token: Option<String>,
) -> Result<Self, Error>
pub async fn connect( zone: usize, endpoint: &str, bucket: impl Into<String>, bearer_token: Option<String>, ) -> Result<Self, Error>
Connect a zonal bucket with an optional static bearer token.
The bucket must be a full v2 resource name such as
projects/_/buckets/example-zone-a. All replicas created by the factory
share the routing token learned from zonal write redirects. The normal
production endpoint is https://storage.googleapis.com; Cloud Storage
regional JSON/XML endpoints do not support this gRPC client.
Sourcepub fn from_channel(
zone: usize,
channel: Channel,
bucket: impl Into<String>,
bearer_token: Option<String>,
) -> Self
pub fn from_channel( zone: usize, channel: Channel, bucket: impl Into<String>, bearer_token: Option<String>, ) -> Self
Build a factory over an already-established channel. The deterministic
simulator uses this to route the production client over a simulated
transport (Endpoint::connect_with_connector); production callers use
connect/connect_with_auth.
Sourcepub async fn connect_with_auth(
zone: usize,
endpoint: &str,
bucket: impl Into<String>,
auth: BearerAuth,
) -> Result<Self, Error>
pub async fn connect_with_auth( zone: usize, endpoint: &str, bucket: impl Into<String>, auth: BearerAuth, ) -> Result<Self, Error>
Connect a zonal bucket using a shared static or refreshing auth handle.
Cloned refreshing handles update existing clients through ArcSwap.
Use full v2 bucket resource names and a gRPC-compatible endpoint such as
https://storage.googleapis.com.
Trait Implementations§
Source§impl Clone for GrpcReplicaFactory
impl Clone for GrpcReplicaFactory
Source§fn clone(&self) -> GrpcReplicaFactory
fn clone(&self) -> GrpcReplicaFactory
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for GrpcReplicaFactory
impl !RefUnwindSafe for GrpcReplicaFactory
impl !UnwindSafe for GrpcReplicaFactory
impl Send for GrpcReplicaFactory
impl Sync for GrpcReplicaFactory
impl Unpin for GrpcReplicaFactory
impl UnsafeUnpin for GrpcReplicaFactory
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
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>
T in a tonic::Request