pub enum DocTarget {
Document(Box<DriveFile>),
Shortcut {
name: String,
},
NotADocument {
name: String,
mime_type: String,
},
}Expand description
What a Drive file id turned out to be.
Variants§
Document(Box<DriveFile>)
A Google Doc. Carries the full metadata, so a write engine can read
parents for the gate without a second files.get.
Shortcut
A shortcut. Never followed — its own variant, because “this is not a Google Doc” is a confusing thing to say about a shortcut to one.
NotADocument
Anything else.
Implementations§
Source§impl DocTarget
impl DocTarget
Sourcepub fn of(file: DriveFile) -> Self
pub fn of(file: DriveFile) -> Self
Classifies already-fetched metadata.
Split from classify so the mime-type reasoning is testable
without a server, and so a write engine that already holds the
metadata does not fetch it twice.
Sourcepub fn refusal_message(&self, verb: &str) -> Option<String>
pub fn refusal_message(&self, verb: &str) -> Option<String>
The refusal message, or None when this is a Google Doc.
verb is the CLI spelling (read, info, …) so the message names
the command the user actually typed.
Trait Implementations§
impl Eq for DocTarget
impl StructuralPartialEq for DocTarget
Auto Trait Implementations§
impl Freeze for DocTarget
impl RefUnwindSafe for DocTarget
impl Send for DocTarget
impl Sync for DocTarget
impl Unpin for DocTarget
impl UnsafeUnpin for DocTarget
impl UnwindSafe for DocTarget
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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