pub struct Server<T> { /* private fields */ }
Expand description
A Prefork Server.
A server is used to fork()
child processes.
Implementations§
Source§impl<T> Server<T>
impl<T> Server<T>
Sourcepub fn from_resource(
resource: T,
child_init: Box<dyn Fn(u32, T)>,
num_processes: u32,
) -> Self
pub fn from_resource( resource: T, child_init: Box<dyn Fn(u32, T)>, num_processes: u32, ) -> Self
Create a server.
The resource
is passed to child processes.
The child_init()
function is called in each child process.
There will be num_processes
forked in a call to prefork()
.
Auto Trait Implementations§
impl<T> Freeze for Server<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Server<T>
impl<T> !Send for Server<T>
impl<T> !Sync for Server<T>
impl<T> Unpin for Server<T>where
T: Unpin,
impl<T> !UnwindSafe for Server<T>
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