[][src]Struct xmpp_parsers::jingle_ft::File

pub struct File {
    pub date: Option<DateTime>,
    pub media_type: Option<String>,
    pub name: Option<String>,
    pub descs: BTreeMap<String, Desc>,
    pub size: Option<u64>,
    pub range: Option<Range>,
    pub hashes: Vec<Hash>,
}

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, Desc>

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.

Methods

impl File[src]

pub fn new() -> File[src]

Creates a new file descriptor.

pub fn with_date(self, date: DateTime) -> File[src]

Sets the date of last modification on this file.

pub fn with_date_str(self, date: &str) -> Result<File, Error>[src]

Sets the date of last modification on this file from an ISO-8601 string.

pub fn with_media_type(self, media_type: String) -> File[src]

Sets the MIME type of this file.

pub fn with_name(self, name: String) -> File[src]

Sets the name of this file.

pub fn add_desc(self, lang: &str, desc: Desc) -> File[src]

Sets a description for this file.

pub fn with_size(self, size: u64) -> File[src]

Sets the file size of this file, in bytes.

pub fn with_range(self, range: Range) -> File[src]

Request only a range of this file.

pub fn add_hash(self, hash: Hash) -> File[src]

Add a hash on this file.

Trait Implementations

impl From<File> for Element[src]

impl Clone for File[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for File[src]

impl Debug for File[src]

impl TryFrom<Element> for File[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl Send for File

impl Unpin for File

impl Sync for File

impl UnwindSafe for File

impl RefUnwindSafe for File

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> IntoElements for T where
    T: Into<Element>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self