pub enum WebServerDestination {
Addr(SocketAddr),
Url(Url),
}Available on crate feature
netcode only.Expand description
Represents a WebTransport server destination.
When setting up WebTransport servers and clients, this destination must be used.
WebTransportClientConfig::server_dest: Set the destination here. This tells the client where to connect.ServerSetupConfig::server_addresses: Store the destination as aSocketAddrin the server addresses for the WebTransport server. This is used to validate connect tokens.ClientAuthentication: Use the destination inClientAuthentication::Unsecure::server_addressor inConnectToken::generate()for secure auth. The server address is used internally byrenet2to coordinate packet sending and receiving.
The conversion SocketAddr::from(WebServerDestination::Url) is not reversible. The conversion involves
hashing the URL and pasting it into the socket address bytes (28 bytes total).
Variants§
Addr(SocketAddr)
Url(Url)
The server destination as a URL.
This URL must include the port number explicitly.
Trait Implementations§
Source§impl Clone for WebServerDestination
impl Clone for WebServerDestination
Source§fn clone(&self) -> WebServerDestination
fn clone(&self) -> WebServerDestination
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 WebServerDestination
impl Debug for WebServerDestination
Source§impl<'de> Deserialize<'de> for WebServerDestination
impl<'de> Deserialize<'de> for WebServerDestination
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WebServerDestination, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WebServerDestination, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<SocketAddr> for WebServerDestination
impl From<SocketAddr> for WebServerDestination
Source§fn from(addr: SocketAddr) -> WebServerDestination
fn from(addr: SocketAddr) -> WebServerDestination
Converts to this type from the input type.
Source§impl From<Url> for WebServerDestination
impl From<Url> for WebServerDestination
Source§fn from(url: Url) -> WebServerDestination
fn from(url: Url) -> WebServerDestination
Converts to this type from the input type.
Source§impl Serialize for WebServerDestination
impl Serialize for WebServerDestination
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
Auto Trait Implementations§
impl Freeze for WebServerDestination
impl RefUnwindSafe for WebServerDestination
impl Send for WebServerDestination
impl Sync for WebServerDestination
impl Unpin for WebServerDestination
impl UnwindSafe for WebServerDestination
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of this value.