Enum smoldot_light::platform::Address
source · pub enum Address<'a> {
TcpDns {
hostname: &'a str,
port: u16,
},
TcpIp {
ip: IpAddr,
port: u16,
},
WebSocketIp {
ip: IpAddr,
port: u16,
},
WebSocketDns {
hostname: &'a str,
port: u16,
secure: bool,
},
}
Expand description
Address passed to PlatformRef::connect_stream
.
Variants§
TcpDns
TCP/IP connection with a domain name.
Fields
hostname: &'a str
DNS hostname to connect to.
Note: According to RFC2181 section 11, a domain name is not necessarily an UTF-8 string. Any binary data can be used as a domain name, provided it follows a few restrictions (notably its length). However, in the context of the
PlatformRef
trait, we automatically consider as non-supported a multiaddress that contains a non-UTF-8 domain name, for the sake of simplicity.
TcpIp
TCP/IP connection with an IP address.
WebSocketIp
WebSocket connection with an IP address.
WebSocketDns
WebSocket connection with a domain name.
Fields
hostname: &'a str
DNS hostname to connect to.
Note: According to RFC2181 section 11, a domain name is not necessarily an UTF-8 string. Any binary data can be used as a domain name, provided it follows a few restrictions (notably its length). However, in the context of the
PlatformRef
trait, we automatically consider as non-supported a multiaddress that contains a non-UTF-8 domain name, for the sake of simplicity.
Trait Implementations§
source§impl<'a> From<&'a Address<'a>> for ConnectionType
impl<'a> From<&'a Address<'a>> for ConnectionType
source§fn from(address: &'a Address<'a>) -> ConnectionType
fn from(address: &'a Address<'a>) -> ConnectionType
impl<'a> Copy for Address<'a>
impl<'a> Eq for Address<'a>
impl<'a> StructuralPartialEq for Address<'a>
Auto Trait Implementations§
impl<'a> Freeze for Address<'a>
impl<'a> RefUnwindSafe for Address<'a>
impl<'a> Send for Address<'a>
impl<'a> Sync for Address<'a>
impl<'a> Unpin for Address<'a>
impl<'a> UnwindSafe for Address<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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