pub struct Origin {
pub username: Option<String>,
pub sess_id: String,
pub sess_version: u64,
pub nettype: NetType,
pub addrtype: AddrType,
pub unicast_address: String,
}Expand description
Originator of the session.
See RFC 8866 Section 5.2 for more details.
Fields§
§username: Option<String>User’s login on the originating host.
sess_id: StringSession ID to make the whole Origin unique.
Must be a numeric string but this is not checked.
sess_version: u64Session version number.
nettype: NetTypeType of network for this session.
addrtype: AddrTypeType of the unicast_address.
unicast_address: StringAddress where the session was created.
Implementations§
Source§impl Origin
impl Origin
Sourcepub fn with_ip_addr(
sess_id: impl ToString,
sess_version: u64,
unicast_address: impl Into<IpAddr>,
) -> Self
pub fn with_ip_addr( sess_id: impl ToString, sess_version: u64, unicast_address: impl Into<IpAddr>, ) -> Self
Construct an Origin with the specified IP unicast_address
Sourcepub fn new(
sess_id: impl ToString,
sess_version: u64,
nettype: NetType,
addrtype: AddrType,
unicast_address: impl ToString,
) -> Self
pub fn new( sess_id: impl ToString, sess_version: u64, nettype: NetType, addrtype: AddrType, unicast_address: impl ToString, ) -> Self
Construct an Origin
See also Origin::with_ip_addr
Sourcepub fn set_unicast_ip_address(&mut self, unicast_address: impl Into<IpAddr>)
pub fn set_unicast_ip_address(&mut self, unicast_address: impl Into<IpAddr>)
Sets the unicast_address & addrtype of self from the specified IpAddr
Sourcepub fn try_parse_unicast_ip_address(&self) -> Result<IpAddr, &str>
pub fn try_parse_unicast_ip_address(&self) -> Result<IpAddr, &str>
Returns the Ok with the parsed IpAddr or Err with the string address
if parsing failed.
pub fn set_username(&mut self, username: impl ToString)
Sourcepub fn builder_with_ip_addr(
sess_id: impl ToString,
sess_version: u64,
unicast_address: impl Into<IpAddr>,
) -> Origin
pub fn builder_with_ip_addr( sess_id: impl ToString, sess_version: u64, unicast_address: impl Into<IpAddr>, ) -> Origin
Construct an crate::builders::Origin with the specified IP unicast_address
Sourcepub fn builder(
sess_id: impl ToString,
sess_version: u64,
nettype: NetType,
addrtype: AddrType,
unicast_address: impl ToString,
) -> Origin
pub fn builder( sess_id: impl ToString, sess_version: u64, nettype: NetType, addrtype: AddrType, unicast_address: impl ToString, ) -> Origin
Construct an crate::builders::Origin
See also Origin::builder_with_ip_addr
Trait Implementations§
impl Eq for Origin
impl StructuralPartialEq for Origin
Auto Trait Implementations§
impl Freeze for Origin
impl RefUnwindSafe for Origin
impl Send for Origin
impl Sync for Origin
impl Unpin for Origin
impl UnsafeUnpin for Origin
impl UnwindSafe for Origin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more