pub struct EndpointTicket { /* private fields */ }Available on crate feature
ticket only.Expand description
A token containing information for establishing a connection to an endpoint.
Contains
- The
EndpointIdof the endpoint to connect to (a 32-byte ed25519 public key). - If used, the ’RelayUrl` of on which the endpoint can be reached.
- Any direct addresses on which the endpoint might be reachable.
This allows establishing a connection to the endpoint in most circumstances where it is possible to do so.
This EndpointTicket is a single item which can be easily serialized and deserialized and
implements the Ticket trait. The Display and FromStr traits can also be
used to round-trip the ticket to string.
Implementations§
Source§impl EndpointTicket
impl EndpointTicket
Sourcepub fn new(node: EndpointAddr) -> Self
pub fn new(node: EndpointAddr) -> Self
Creates a new ticket.
Sourcepub fn endpoint_addr(&self) -> &EndpointAddr
pub fn endpoint_addr(&self) -> &EndpointAddr
The EndpointAddr of the provider for this ticket.
Trait Implementations§
Source§impl Clone for EndpointTicket
impl Clone for EndpointTicket
Source§fn clone(&self) -> EndpointTicket
fn clone(&self) -> EndpointTicket
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 moreSource§impl Debug for EndpointTicket
impl Debug for EndpointTicket
Source§impl<'de> Deserialize<'de> for EndpointTicket
impl<'de> Deserialize<'de> for EndpointTicket
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for EndpointTicket
impl Display for EndpointTicket
Source§impl From<EndpointAddr> for EndpointTicket
impl From<EndpointAddr> for EndpointTicket
Source§fn from(addr: EndpointAddr) -> Self
fn from(addr: EndpointAddr) -> Self
Creates a ticket from given addressing info.
Source§impl From<EndpointTicket> for EndpointAddr
impl From<EndpointTicket> for EndpointAddr
Source§fn from(ticket: EndpointTicket) -> Self
fn from(ticket: EndpointTicket) -> Self
Returns the addressing info from given ticket.
Source§impl FromStr for EndpointTicket
impl FromStr for EndpointTicket
Source§impl PartialEq for EndpointTicket
impl PartialEq for EndpointTicket
Source§impl Serialize for EndpointTicket
impl Serialize for EndpointTicket
Source§impl Ticket for EndpointTicket
impl Ticket for EndpointTicket
Source§fn from_bytes(bytes: &[u8]) -> Result<Self, ParseError>
fn from_bytes(bytes: &[u8]) -> Result<Self, ParseError>
Deserialize from the base32 string representation bytes.
Source§fn deserialize(str: &str) -> Result<Self, ParseError>
fn deserialize(str: &str) -> Result<Self, ParseError>
Deserialize from a string.
impl Eq for EndpointTicket
impl StructuralPartialEq for EndpointTicket
Auto Trait Implementations§
impl Freeze for EndpointTicket
impl RefUnwindSafe for EndpointTicket
impl Send for EndpointTicket
impl Sync for EndpointTicket
impl Unpin for EndpointTicket
impl UnwindSafe for EndpointTicket
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