pub struct SonetServer {
pub socket_address: SocketAddr,
pub client_handlers: Vec<Box<dyn Fn(&mut Client)>>,
}Expand description
The SonetServer struct
Fields§
§socket_address: SocketAddr§client_handlers: Vec<Box<dyn Fn(&mut Client)>>Implementations§
Source§impl SonetServer
The Default Implementation
impl SonetServer
The Default Implementation
Sourcepub async fn new(port: i32) -> Result<SonetServer, Error>
pub async fn new(port: i32) -> Result<SonetServer, Error>
New SonetServer Future. Requires Asynchronous runtime
Sourcepub async fn start(&self, registry: PacketRegistry) -> Result<(), Error>
pub async fn start(&self, registry: PacketRegistry) -> Result<(), Error>
Starts the server. This requires the asynchronous runtime
pub fn add_client_handler<T>(&mut self, closure: T)
pub fn stop(&mut self)
Auto Trait Implementations§
impl Freeze for SonetServer
impl !RefUnwindSafe for SonetServer
impl !Send for SonetServer
impl !Sync for SonetServer
impl Unpin for SonetServer
impl !UnwindSafe for SonetServer
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