pub struct OscServer { /* private fields */ }Expand description
A UDP OSC server that listens for packets and dispatches them to registered pattern handlers.
Implementations§
Source§impl OscServer
impl OscServer
Sourcepub async fn bind(addr: impl ToSocketAddrs) -> Result<Self, Error>
pub async fn bind(addr: impl ToSocketAddrs) -> Result<Self, Error>
Bind the server to the given UDP socket address.
Sourcepub fn handle<F>(&mut self, pattern: impl Into<String>, f: F)
pub fn handle<F>(&mut self, pattern: impl Into<String>, f: F)
Register a handler for OSC messages matching the given pattern.
Sourcepub fn set_buffer_size(&mut self, size: usize)
pub fn set_buffer_size(&mut self, size: usize)
Set the receive buffer size in bytes (default 65536).
Sourcepub fn local_addr(&self) -> Result<SocketAddr, Error>
pub fn local_addr(&self) -> Result<SocketAddr, Error>
Get the local socket address the server is bound to.
Auto Trait Implementations§
impl !RefUnwindSafe for OscServer
impl !UnwindSafe for OscServer
impl Freeze for OscServer
impl Send for OscServer
impl Sync for OscServer
impl Unpin for OscServer
impl UnsafeUnpin for OscServer
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