pub struct ServerRecord { /* private fields */ }Expand description
What’s needed to connect to a CM server.
Implementations§
Source§impl ServerRecord
impl ServerRecord
Sourcepub fn new(end_point: EndPoint, protocol_types: ProtocolTypes) -> Self
pub fn new(end_point: EndPoint, protocol_types: ProtocolTypes) -> Self
Creates a server record for the given endpoint and protocol types.
Sourcepub fn end_point(&self) -> SocketAddr
pub fn end_point(&self) -> SocketAddr
The address to connect to. For the host name, if there is one, use
ServerRecord::endpoint.
Sourcepub fn endpoint(&self) -> &EndPoint
pub fn endpoint(&self) -> &EndPoint
The full endpoint, including the host name if there is one.
Sourcepub fn protocol_types(&self) -> ProtocolTypes
pub fn protocol_types(&self) -> ProtocolTypes
The protocols that can be used to talk to this server.
Sourcepub async fn create_server(
host: &str,
port: u16,
protocol_types: ProtocolTypes,
) -> Result<Self, SteamError>
pub async fn create_server( host: &str, port: u16, protocol_types: ProtocolTypes, ) -> Result<Self, SteamError>
Creates a record for the given host and port. A host name is resolved to an address.
Sourcepub fn create_socket_server(end_point: SocketAddr) -> Self
pub fn create_socket_server(end_point: SocketAddr) -> Self
Creates a TCP/UDP server record for an IP endpoint.
Sourcepub fn try_create_socket_server(address: &str) -> Option<Self>
pub fn try_create_socket_server(address: &str) -> Option<Self>
Creates a TCP/UDP server record from an address string. Returns None
if it can’t be parsed.
Sourcepub async fn create_dns_socket_server(address: &str) -> Result<Self, SteamError>
pub async fn create_dns_socket_server(address: &str) -> Result<Self, SteamError>
Creates a TCP/UDP server record from a “host:port” address. The port defaults to 443.
Sourcepub async fn create_websocket_server(address: &str) -> Result<Self, SteamError>
pub async fn create_websocket_server(address: &str) -> Result<Self, SteamError>
Creates a WebSocket server record from a “host:port” address. The port defaults to 443.
Trait Implementations§
Source§impl Clone for ServerRecord
impl Clone for ServerRecord
Source§impl Debug for ServerRecord
impl Debug for ServerRecord
Source§impl Display for ServerRecord
impl Display for ServerRecord
impl Eq for ServerRecord
Source§impl Hash for ServerRecord
impl Hash for ServerRecord
Auto Trait Implementations§
impl Freeze for ServerRecord
impl RefUnwindSafe for ServerRecord
impl Send for ServerRecord
impl Sync for ServerRecord
impl Unpin for ServerRecord
impl UnsafeUnpin for ServerRecord
impl UnwindSafe for ServerRecord
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.