pub struct Server { /* private fields */ }Expand description
CemuHook UDP Server
Implementations§
Source§impl Server
impl Server
Sourcepub fn new(
running: Arc<AtomicBool>,
config: ServerConfig,
) -> Result<Self, ServerError>
pub fn new( running: Arc<AtomicBool>, config: ServerConfig, ) -> Result<Self, ServerError>
Attempt to create a new Server.
The first argument is an AtomicBool within an Arc<>
that, when false, signals that the server should be shut down.
Sourcepub fn run(
&self,
rx: Receiver<DSUFrame>,
) -> Result<(Result<()>, Result<(), Box<dyn Any + Send + 'static>>), ServerError>
pub fn run( &self, rx: Receiver<DSUFrame>, ) -> Result<(Result<()>, Result<(), Box<dyn Any + Send + 'static>>), ServerError>
Start the CemuHook UDP server and broadcast frames received on rx to all subscribed CemuHook clients
Blocks until both the Receving loop (this thread) and Send loop (background thread) complete
Returns both results on Success, Err(ServerError) if the server failed to start
Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin 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