Struct spacegate_kernel::listener::SgListen
source · pub struct SgListen<S> {
pub socket_addr: SocketAddr,
pub service: S,
pub tls_cfg: Option<Arc<ServerConfig>>,
pub cancel_token: CancellationToken,
pub listener_id: String,
/* private fields */
}Expand description
Listener embodies the concept of a logical endpoint where a Gateway accepts network connections.
Fields§
§socket_addr: SocketAddr§service: S§tls_cfg: Option<Arc<ServerConfig>>§cancel_token: CancellationToken§listener_id: StringImplementations§
source§impl<S> SgListen<S>
impl<S> SgListen<S>
sourcepub fn new(
socket_addr: SocketAddr,
service: S,
cancel_token: CancellationToken
) -> Self
pub fn new( socket_addr: SocketAddr, service: S, cancel_token: CancellationToken ) -> Self
we only have 65535 ports for a console, so it’s a safe size
sourcepub fn with_tls_config(self, tls_cfg: impl Into<Arc<ServerConfig>>) -> Self
pub fn with_tls_config(self, tls_cfg: impl Into<Arc<ServerConfig>>) -> Self
Set the TLS config for this listener. see rustls::ServerConfig
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for SgListen<S>where
S: Freeze,
impl<S> !RefUnwindSafe for SgListen<S>
impl<S> Send for SgListen<S>where
S: Send,
impl<S> Sync for SgListen<S>where
S: Sync,
impl<S> Unpin for SgListen<S>where
S: Unpin,
impl<S> !UnwindSafe for SgListen<S>
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