pub struct EndpointTicket { /* private fields */ }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). - Any known
TransportAddrs on which the endpoint can be reached.
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 round-trip
the canonical string form via Ticket::encode_string / Ticket::decode_string.
Implementations§
Source§impl EndpointTicket
impl EndpointTicket
Sourcepub fn new(addr: EndpointAddr) -> EndpointTicket
pub fn new(addr: EndpointAddr) -> EndpointTicket
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 (const: unstable) · 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: D,
) -> Result<EndpointTicket, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<EndpointTicket, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for EndpointTicket
impl Display for EndpointTicket
impl Eq for EndpointTicket
Source§impl From<EndpointAddr> for EndpointTicket
impl From<EndpointAddr> for EndpointTicket
Source§fn from(addr: EndpointAddr) -> EndpointTicket
fn from(addr: EndpointAddr) -> EndpointTicket
Creates a ticket from given addressing info.
Source§impl From<EndpointTicket> for EndpointAddr
impl From<EndpointTicket> for EndpointAddr
Source§fn from(ticket: EndpointTicket) -> EndpointAddr
fn from(ticket: EndpointTicket) -> EndpointAddr
Returns the addressing info from given ticket.
Source§impl FromStr for EndpointTicket
impl FromStr for EndpointTicket
Source§type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<EndpointTicket, <EndpointTicket as FromStr>::Err>
fn from_str(s: &str) -> Result<EndpointTicket, <EndpointTicket as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl PartialEq for EndpointTicket
impl PartialEq for EndpointTicket
Source§impl Serialize for EndpointTicket
impl Serialize for EndpointTicket
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for EndpointTicket
Source§impl Ticket for EndpointTicket
impl Ticket for EndpointTicket
Source§const KIND: &'static str = "endpoint"
const KIND: &'static str = "endpoint"
String prefix describing the kind of iroh ticket. Read more
Source§fn decode_bytes(bytes: &[u8]) -> Result<EndpointTicket, ParseError>
fn decode_bytes(bytes: &[u8]) -> Result<EndpointTicket, ParseError>
Decode a ticket from its byte representation.
Source§fn encode_string(&self) -> String
fn encode_string(&self) -> String
Encode the ticket into its canonical string form. Read more
Source§fn decode_string(s: &str) -> Result<Self, ParseError>
fn decode_string(s: &str) -> Result<Self, ParseError>
Decode a ticket from its canonical string form. Read more
Auto Trait Implementations§
impl Freeze for EndpointTicket
impl RefUnwindSafe for EndpointTicket
impl Send for EndpointTicket
impl Sync for EndpointTicket
impl Unpin for EndpointTicket
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more