pub struct DocsClient { /* private fields */ }Expand description
HTTP client for the Docs v1 REST API.
Implementations§
Source§impl DocsClient
impl DocsClient
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 Docs client from a Drive client, sharing its OAuth session and connection pool.
This is the constructor every real caller wants. A docs replace has
to talk to both APIs — Drive for files.get and the ancestor-chain
walk that feeds the write gate, Docs for the text — and two
independent sessions would refresh the same refresh token twice for
one command.
Honours DOCS_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 DocsClient
impl !UnwindSafe for DocsClient
impl Freeze for DocsClient
impl Send for DocsClient
impl Sync for DocsClient
impl Unpin for DocsClient
impl UnsafeUnpin for DocsClient
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