pub struct SgListen {
pub socket_addr: SocketAddr,
pub services: Vec<Arc<dyn TcpService>>,
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§services: Vec<Arc<dyn TcpService>>§listener_id: StringImplementations§
Source§impl SgListen
impl SgListen
Sourcepub fn new(socket_addr: SocketAddr, cancel_token: CancellationToken) -> Self
pub fn new(socket_addr: SocketAddr, cancel_token: CancellationToken) -> Self
we only have 65535 ports for a console, so it’s a safe size
pub fn with_service<S: TcpService>(self, service: S) -> Self
pub fn add_service<S: TcpService>(&mut self, service: S)
pub fn with_services(self, services: Vec<Arc<dyn TcpService>>) -> Self
pub fn extend_services(&mut self, services: Vec<Arc<dyn TcpService>>)
pub fn with_listener_id(self, listener_id: impl Into<String>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SgListen
impl !RefUnwindSafe for SgListen
impl Send for SgListen
impl Sync for SgListen
impl Unpin for SgListen
impl !UnwindSafe for SgListen
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