Struct AttachmentSummary
pub struct AttachmentSummary<'a> {
pub kind: AttachmentKind,
pub name: &'a str,
pub size: Option<u64>,
pub availability: Availability,
pub saved: Option<SavedCopy>,
}Expand description
Everything the ladder needs to know about one attachment.
Fields§
§kind: AttachmentKind§name: &'a strThe name it was shared under: the identity of the file, used for the save dialog’s suggestion.
size: Option<u64>Its size in bytes, when known.
availability: Availability§saved: Option<SavedCopy>Where a copy was saved, if the person saved one in this session.
Implementations§
§impl<'a> AttachmentSummary<'a>
impl<'a> AttachmentSummary<'a>
pub fn ready(
kind: AttachmentKind,
name: &'a str,
size: Option<u64>,
) -> AttachmentSummary<'a>
pub fn ready( kind: AttachmentKind, name: &'a str, size: Option<u64>, ) -> AttachmentSummary<'a>
An attachment whose bytes are here.
pub fn in_state(self, availability: Availability) -> AttachmentSummary<'a>
pub fn in_state(self, availability: Availability) -> AttachmentSummary<'a>
The same attachment, in another state.
pub fn saved_as(self, saved: SavedCopy) -> AttachmentSummary<'a>
pub fn saved_as(self, saved: SavedCopy) -> AttachmentSummary<'a>
The same attachment, with the copy the person saved.
pub fn actions(&self) -> Vec<AttachmentAction>
pub fn actions(&self) -> Vec<AttachmentAction>
The rungs on offer, in order: open, save, open the saved copy — or cancel, while the transport is still working.
A picture that cannot be read offers nothing: the ladder starts below a
preview that is not there, and Self::unavailable_reason says why in
the place the rungs would have been.
Why there is nothing to do, when there is nothing to do.
pub fn suggested_name(&self) -> String
pub fn suggested_name(&self) -> String
The name the save dialog suggests: the name it was shared under.
pub fn describe(&self) -> String
pub fn describe(&self) -> String
What a screen reader hears for this attachment: what it is, what it is called, how big it is, and what state it is in. A copy on this device is stated as a state rather than announced as an event: saving says nothing unless it stalls or fails, and a person reading a list with a screen reader still needs to know where the file is.
Trait Implementations§
§impl<'a> Clone for AttachmentSummary<'a>
impl<'a> Clone for AttachmentSummary<'a>
§fn clone(&self) -> AttachmentSummary<'a>
fn clone(&self) -> AttachmentSummary<'a>
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<'a> Freeze for AttachmentSummary<'a>
impl<'a> RefUnwindSafe for AttachmentSummary<'a>
impl<'a> Send for AttachmentSummary<'a>
impl<'a> Sync for AttachmentSummary<'a>
impl<'a> Unpin for AttachmentSummary<'a>
impl<'a> UnsafeUnpin for AttachmentSummary<'a>
impl<'a> UnwindSafe for AttachmentSummary<'a>
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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>
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>
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