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
impl Port
[src]
impl Port
[src]pub fn ftp_control() -> Port
[src]
pub fn ftp_control() -> Port
[src]Well-known port for FTP protocol.
pub fn default_for(scheme: &Scheme) -> Option<Port>
[src]
pub fn default_for(scheme: &Scheme) -> Option<Port>
[src]Return the default port for the provided Scheme
, if one is known.
Trait Implementations
impl Eq for Port
[src]
impl StructuralEq for Port
[src]
impl StructuralPartialEq for Port
[src]
Auto Trait Implementations
impl RefUnwindSafe for Port
impl Send for Port
impl Sync for Port
impl Unpin for Port
impl UnwindSafe for Port
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more