pub struct QuicDatagramService { /* private fields */ }Expand description
QUIC server-side datagram listener (BackgroundService).
Implementations§
Source§impl QuicDatagramService
impl QuicDatagramService
Sourcepub fn from_tls(
bind_addr: SocketAddr,
tls: Tls,
alpn: Vec<Vec<u8>>,
retry: bool,
handler: QuicDatagramHandler,
) -> Result<Self>
pub fn from_tls( bind_addr: SocketAddr, tls: Tls, alpn: Vec<Vec<u8>>, retry: bool, handler: QuicDatagramHandler, ) -> Result<Self>
Build from an existing sova_core::Tls (share with HTTPS via Clone).
pub fn from_pem( bind_addr: SocketAddr, cert_path: impl AsRef<Path>, key_path: impl AsRef<Path>, alpn: Vec<Vec<u8>>, retry: bool, handler: QuicDatagramHandler, ) -> Result<Self>
Optional preshared token inside datagrams: token + b':' + payload.
If token is None, no validation is performed.
Sourcepub fn install(self, app: &mut App)
pub fn install(self, app: &mut App)
Register as a BackgroundService and attach TLS to the app HTTPS listener.
Prefer this over app.service(…) + bind(…).tls(…) — one Tls handle wires both.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for QuicDatagramService
impl !UnwindSafe for QuicDatagramService
impl Freeze for QuicDatagramService
impl Send for QuicDatagramService
impl Sync for QuicDatagramService
impl Unpin for QuicDatagramService
impl UnsafeUnpin for QuicDatagramService
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