pub struct Server { /* private fields */ }
Implementations§
Source§impl Server
impl Server
pub fn new() -> Server
Sourcepub fn listen_addr(&self) -> Option<SocketAddr>
pub fn listen_addr(&self) -> Option<SocketAddr>
Get the socket address the server is bound to. Returns None if server is not bound to a socket yet
Sourcepub async fn bind<T: ToSocketAddrs>(
&mut self,
listen_addr: T,
) -> Result<(), Box<dyn Error>>
pub async fn bind<T: ToSocketAddrs>( &mut self, listen_addr: T, ) -> Result<(), Box<dyn Error>>
Bind the server to listen to an address
pub async fn run(&self) -> Result<(), Box<dyn Error>>
Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnwindSafe for Server
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