pub struct RouterAddress {
pub cost: u8,
pub expires: Date,
pub transport: TransportKind,
pub options: Mapping,
pub socket_address: Option<SocketAddr>,
}Expand description
Router address.
Fields§
§cost: u8Router cost.
expires: DateWhen the router expires (always 0).
transport: TransportKindTransport.
options: MappingOptions.
socket_address: Option<SocketAddr>Router’s socket address.
Implementations§
Source§impl RouterAddress
impl RouterAddress
Sourcepub fn new_unpublished_ntcp2(key: [u8; 32], port: u16) -> Self
pub fn new_unpublished_ntcp2(key: [u8; 32], port: u16) -> Self
Create new unpublished NTCP2 RouterAddress.
Sourcepub fn new_published_ntcp2(
key: [u8; 32],
iv: [u8; 16],
port: u16,
host: Ipv4Addr,
) -> Self
pub fn new_published_ntcp2( key: [u8; 32], iv: [u8; 16], port: u16, host: Ipv4Addr, ) -> Self
Create new unpublished NTCP2 RouterAddress.
Sourcepub fn new_unpublished_ssu2(
static_key: [u8; 32],
intro_key: [u8; 32],
port: u16,
) -> Self
pub fn new_unpublished_ssu2( static_key: [u8; 32], intro_key: [u8; 32], port: u16, ) -> Self
Create new unpublished SSU2 RouterAddress.
Sourcepub fn new_published_ssu2(
static_key: [u8; 32],
intro_key: [u8; 32],
port: u16,
host: Ipv4Addr,
) -> Self
pub fn new_published_ssu2( static_key: [u8; 32], intro_key: [u8; 32], port: u16, host: Ipv4Addr, ) -> Self
Create new unpublished SSU2 RouterAddress.
Sourcepub fn parse_frame(
input: &[u8],
) -> IResult<&[u8], RouterAddress, RouterAddressParseError>
pub fn parse_frame( input: &[u8], ) -> IResult<&[u8], RouterAddress, RouterAddressParseError>
Parse RouterAddress from input, returning rest of input and parsed address.
Sourcepub fn parse(
bytes: impl AsRef<[u8]>,
) -> Result<RouterAddress, RouterAddressParseError>
pub fn parse( bytes: impl AsRef<[u8]>, ) -> Result<RouterAddress, RouterAddressParseError>
Try to convert bytes into a RouterAddress.
Sourcepub fn serialize(&self) -> BytesMut
pub fn serialize(&self) -> BytesMut
Serialize RouterAddress.
Trait Implementations§
Source§impl Clone for RouterAddress
impl Clone for RouterAddress
Source§fn clone(&self) -> RouterAddress
fn clone(&self) -> RouterAddress
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RouterAddress
impl RefUnwindSafe for RouterAddress
impl Send for RouterAddress
impl Sync for RouterAddress
impl Unpin for RouterAddress
impl UnwindSafe for RouterAddress
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