Struct rdftk_iri::Authority [−][src]
pub struct Authority { /* fields omitted */ }
Expand description
Provides the Authority
component of an IRI
comprising host, user information, and port
sub-components. All but the host sub-components are optional.
- The required host component is either a domain name, or IP address in IPV4 or IPV6 format.
- The optional user information component consists of a required user name and optional password.
- The optional port is simply an unsigned integer.
Example
use rdftk_iri::authority::{Authority, Host, Port}; use std::str::FromStr; let http_authority = Authority::new_with_port( Host::from_str("www.example.com").unwrap(), Port::http() ); assert!(http_authority.has_port()); assert!(!http_authority.has_user_info());
Implementations
Construct a new Authority
instance with only the specified Host
value. Note that the
host is required, other sub-components are optional.
Construct a new Authority
instance with only the required Host
value and the optional
Port
value.
Construct a new Authority
instance with only the required Host
value and the optional
UserInfo
value.
Construct a new Authority
instance with only the required Host
value, the optional
Port
value, and optional UserInfo
value.
Return true
if this authority has a user info value, else false
.
Set the value for port to None
.
Set a new value for user info.
Set the value for user info to None
.
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 Authority
impl UnwindSafe for Authority
Blanket Implementations
Mutably borrows from an owned value. Read more