pub struct File {
pub date: Option<DateTime>,
pub media_type: Option<String>,
pub name: Option<String>,
pub descs: BTreeMap<String, String>,
pub size: Option<u64>,
pub range: Option<Range>,
pub hashes: Vec<Hash>,
}
Expand description
Represents a file to be transferred.
Fields§
§date: Option<DateTime>
The date of last modification of this file.
media_type: Option<String>
The MIME type of this file.
name: Option<String>
The name of this file.
descs: BTreeMap<String, String>
The description of this file, possibly localised.
size: Option<u64>
The size of this file, in bytes.
range: Option<Range>
Used to request only a part of this file.
hashes: Vec<Hash>
A list of hashes matching this entire file.
Implementations§
Source§impl File
impl File
Sourcepub fn with_date(self, date: DateTime) -> File
pub fn with_date(self, date: DateTime) -> File
Sets the date of last modification on this file.
Sourcepub fn with_date_str(self, date: &str) -> Result<File, Error>
pub fn with_date_str(self, date: &str) -> Result<File, Error>
Sets the date of last modification on this file from an ISO-8601 string.
Sourcepub fn with_media_type(self, media_type: String) -> File
pub fn with_media_type(self, media_type: String) -> File
Sets the MIME type of this file.
Sourcepub fn with_range(self, range: Range) -> File
pub fn with_range(self, range: Range) -> File
Request only a range of this file.
Trait Implementations§
Source§impl AsXml for File
impl AsXml for File
Source§impl FromXml for File
impl FromXml for File
Source§fn from_events(
name: QName,
attrs: AttrMap,
ctx: &Context<'_>,
) -> Result<Self::Builder, FromEventsError>
fn from_events( name: QName, attrs: AttrMap, ctx: &Context<'_>, ) -> Result<Self::Builder, FromEventsError>
Attempt to initiate the streamed construction of this struct from XML. Read more
Source§fn xml_name_matcher() -> XmlNameMatcher<'static>
fn xml_name_matcher() -> XmlNameMatcher<'static>
Return a predicate which determines if
Self
may be parsed from
a given XML element. Read moreAuto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
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