pub struct SheetsClient { /* private fields */ }Expand description
HTTP client for the Sheets v4 REST API.
Implementations§
Source§impl SheetsClient
impl SheetsClient
Sourcepub fn new(base_url: &str, credentials: &DriveCredentials) -> Result<Self>
pub fn new(base_url: &str, credentials: &DriveCredentials) -> Result<Self>
Builds a client against base_url with already-loaded credentials.
Prefer Self::from_drive_client when a DriveClient is already in
hand: this constructor opens a second OAuth session, which means a
second token refresh per invocation.
Sourcepub fn from_drive_client(drive: &DriveClient) -> Result<Self>
pub fn from_drive_client(drive: &DriveClient) -> Result<Self>
Derives a Sheets client from a Drive client, sharing its OAuth session and connection pool.
This is the constructor every real caller wants. A sheets write has
to talk to both APIs — Drive for files.get and the ancestor-chain
walk that feeds the write gate, Sheets for the cells — and two
independent sessions would refresh the same refresh token twice for
one command.
Honours SHEETS_API_URL; the Drive client’s own base URL is
irrelevant here, since the two hosts are unrelated.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SheetsClient
impl !UnwindSafe for SheetsClient
impl Freeze for SheetsClient
impl Send for SheetsClient
impl Sync for SheetsClient
impl Unpin for SheetsClient
impl UnsafeUnpin for SheetsClient
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> 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