Struct distant_core::DistantServer
source · [−]pub struct DistantServer { /* private fields */ }Expand description
Represents a server that listens for requests, processes them, and sends responses
Implementations
sourceimpl DistantServer
impl DistantServer
sourcepub async fn bind<U>(
addr: IpAddr,
port: PortRange,
codec: U,
opts: DistantServerOptions
) -> Result<(Self, u16)> where
U: Codec + Send + 'static,
pub async fn bind<U>(
addr: IpAddr,
port: PortRange,
codec: U,
opts: DistantServerOptions
) -> Result<(Self, u16)> where
U: Codec + Send + 'static,
Bind to an IP address and port from the given range, taking an optional shutdown duration that will shutdown the server if there is no active connection after duration
sourcepub fn initialize<T, U, S>(stream: S, opts: DistantServerOptions) -> Self where
T: DataStream + Send + 'static,
U: Codec + Send + 'static,
S: Stream<Item = Transport<T, U>> + Send + Unpin + 'static,
pub fn initialize<T, U, S>(stream: S, opts: DistantServerOptions) -> Self where
T: DataStream + Send + 'static,
U: Codec + Send + 'static,
S: Stream<Item = Transport<T, U>> + Send + Unpin + 'static,
Initialize a distant server using the provided listener
Auto Trait Implementations
impl RefUnwindSafe for DistantServer
impl Send for DistantServer
impl Sync for DistantServer
impl Unpin for DistantServer
impl UnwindSafe for DistantServer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more