pub struct Server<M> { /* private fields */ }Expand description
Holds all information needed to creating and running a single Tunneler-Server
Implementations§
Source§impl Server<Empty>
impl Server<Empty>
Sourcepub fn new(listen_port: u32, port_strategy: Strategy, key: Vec<u8>) -> Self
pub fn new(listen_port: u32, port_strategy: Strategy, key: Vec<u8>) -> Self
Creates a new Server-Instance from the given Data
Params:
- listen_port: The Port clients will connect to
- port_strategy: The Strategy to determine if a port a client wants to use is valid
- key: The Key/Password clients need to connect to the server
Source§impl<M> Server<M>where
M: Metrics,
impl<M> Server<M>where
M: Metrics,
Sourcepub fn new_metrics(
listen_port: u32,
port_strategy: Strategy,
key: Vec<u8>,
p_metrics: M,
) -> Self
pub fn new_metrics( listen_port: u32, port_strategy: Strategy, key: Vec<u8>, p_metrics: M, ) -> Self
Creates a new Server-Instance from the given Data
Params:
- listen_port: The Port clients will connect to
- port_strategy: The Strategy to determine if a port a client wants to use is valid
- key: The Key/Password clients need to connect to the server
- p_metrics: The Metrics-Collector to use
Sourcepub async fn listen(self) -> Result<(), ()>
pub async fn listen(self) -> Result<(), ()>
Actually starts the Server and starts listening for incoming Connections from both users and clients.
§Behaviour
This function is not expected to return as all the connections will be handled internally or by other parts of the System, so this one can keep accepting new ones
Trait Implementations§
impl<M: PartialEq> StructuralPartialEq for Server<M>
Auto Trait Implementations§
impl<M> Freeze for Server<M>
impl<M> RefUnwindSafe for Server<M>where
M: RefUnwindSafe,
impl<M> Send for Server<M>
impl<M> Sync for Server<M>
impl<M> Unpin for Server<M>
impl<M> UnsafeUnpin for Server<M>
impl<M> UnwindSafe for Server<M>where
M: RefUnwindSafe,
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