Struct rdftk_iri::Port [−][src]
pub struct Port(_);
Expand description
This type represents the port component, it is a 16 bit unsigned integer.
Examples
use rdftk_iri::Port; use std::str::FromStr; let http_port: Port = Port::from_str("80").unwrap(); let https_port: Port = 443.into();
A number of well-known ports are also provided as associated functions on the Port
implementation for convenience.
use rdftk_iri::Port; use rdftk_iri::Scheme; let http_port: Port = Port::http(); let https_port: Port = Port::default_for(&Scheme::https()).unwrap();
Finally, there is a difference between to_string
that will format the value for inclusion in
an IRI
string, and value that returns the raw port integer.
use rdftk_iri::Port; let http_port: Port = Port::new(80); println!("'{}'", http_port); // prints '80' println!("'{}'", http_port.value()); // prints '80'
Implementations
Well-known port for FTP protocol.
Return the default port for the provided Scheme
, if one is known.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Port
impl UnwindSafe for Port
Blanket Implementations
Mutably borrows from an owned value. Read more