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§
Source§impl Magnet
impl Magnet
Sourcepub fn new_no_validation(magnet_str: &str) -> Magnet
pub fn new_no_validation(magnet_str: &str) -> Magnet
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.