pub struct GoogleDriveCloudHome { /* private fields */ }Expand description
Google Drive cloud home backend.
Implementations§
Source§impl GoogleDriveCloudHome
impl GoogleDriveCloudHome
pub fn new( folder_id: String, tokens: OAuthTokens, key_service: KeyService, clock: ClockRef, ) -> Self
pub fn oauth_config() -> OAuthConfig
Trait Implementations§
Source§impl CloudHome for GoogleDriveCloudHome
impl CloudHome for GoogleDriveCloudHome
Source§fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write bytes to a key, creating or overwriting.
Source§fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read the full contents of a key.
Source§fn read_range<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
start: u64,
end: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_range<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
start: u64,
end: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read a byte range from a key.
start is inclusive, end is exclusive.Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List all keys under a prefix.
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a key. Not an error if the key does not exist.
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check whether a key exists.
Source§fn grant_access<'life0, 'life1, 'async_trait>(
&'life0 self,
member_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CloudHomeJoinInfo, CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn grant_access<'life0, 'life1, 'async_trait>(
&'life0 self,
member_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CloudHomeJoinInfo, CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Grant access to a member and return connection info for the cloud home.
For S3 this ignores
member_id and returns bucket/region/endpoint
(access is managed externally via IAM/pre-shared credentials).
For consumer clouds this shares the folder with the member’s account.Source§fn revoke_access<'life0, 'life1, 'async_trait>(
&'life0 self,
member_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn revoke_access<'life0, 'life1, 'async_trait>(
&'life0 self,
member_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Revoke a previously granted access. No-op for backends where access
is controlled externally (e.g. S3 with pre-shared credentials).
Source§fn probe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn probe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), CloudHomeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Verify the backend is reachable with the configured credentials.
Setup flows call this before persisting credentials, so a typo or
missing bucket fails fast at setup time instead of via a delayed
reconnect banner. Default implementation issues a no-op list against
a sentinel prefix — backends override with cheaper provider-specific
auth checks (e.g. S3 HeadBucket) where available.
Auto Trait Implementations§
impl !Freeze for GoogleDriveCloudHome
impl !RefUnwindSafe for GoogleDriveCloudHome
impl Send for GoogleDriveCloudHome
impl Sync for GoogleDriveCloudHome
impl Unpin for GoogleDriveCloudHome
impl !UnwindSafe for GoogleDriveCloudHome
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.