Struct magnet_url::Magnet[][src]

pub struct Magnet {
    pub dn: Option<String>,
    pub hash_type: Option<String>,
    pub xt: Option<String>,
    pub xl: Option<u64>,
    pub xs: Option<String>,
    pub tr: Vec<String>,
    pub kt: Option<String>,
    pub ws: Option<String>,
    pub acceptable_source: Option<String>,
    pub mt: Option<String>,
}

Fields

dn: Option<String>

Display Name of the torrent

hash_type: Option<String>

type of hash used in the exact topic

xt: Option<String>

eXact Topic: URN containing the file hash. The URN is specific to the protocol so a file hash URN under btih (BitTorrent) would be completely different than the file hash URN for ed2k

xl: Option<u64>

eXact Length: The size (in bytes)

xs: Option<String>

eXact Source: Either an HTTP (or HTTPS, FTP, FTPS, etc.) download source for the file pointed to by the Magnet link, the address of a P2P source for the file or the address of a hub (in the case of DC++), by which a client tries to connect directly, asking for the file and/or its sources. This field is commonly used by P2P clients to store the source, and may include the file hash.

tr: Vec<String>

address TRacker: Tracker URL; used to obtain resources for BitTorrent downloads without a need for DHT support. The value must be URL encoded

kt: Option<String>

Keyword Topic: Specifies a string of search keywords to search for in P2P networks, rather than a particular file. Also set as a vector since there will likely be more than one

ws: Option<String>

Web Seed: The payload data served over HTTP(S)

acceptable_source: Option<String>

Acceptable Source: Refers to a direct download from a web server. Regarded as only a fall-back source in case a client is unable to locate and/or download the linked-to file in its supported P2P network(s) as is a reserved keyword in Rust, so unfortunately this library must use the full name

mt: Option<String>

Manifest Topic: Link to the metafile that contains a list of magneto (MAGMA – MAGnet MAnifest); i.e. a link to a list of links

Implementations

Given a magnet URL, identify the specific parts, and return the Magnet struct. If the program can’t identify a specific part of the magnet, then it will either give an empty version of what its value would normally be (such as an empty string, an empty vector, or in the case of xl, -1). It also doesn’t validate whether the magnet url is good, which makes it faster, but dangerous! Only use this function if you know for certain that the magnet url given is valid.

The recommended way of creating magnets. The same as new_no_validation, but does validation

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.