pub struct TusHandler<S, L = NoLocker> { /* private fields */ }Expand description
The central tus protocol handler.
Wrap in Arc<TusHandler<S, L>> and share across request-handling tasks.
§Type Parameters
S: Storage backend implementingSendDataStore.L: Optional locker implementingSendLocker. UseNoLockerif concurrency control is handled by the store itself or is not needed.
Implementations§
Source§impl<S, L> TusHandler<S, L>
impl<S, L> TusHandler<S, L>
pub fn new(store: S, locker: Option<L>, config: Config) -> Self
Sourcepub fn hook_receiver(&self) -> Option<Receiver<HookEvent>>
pub fn hook_receiver(&self) -> Option<Receiver<HookEvent>>
Subscribe to lifecycle events. Returns None if hooks are not configured.
Sourcepub async fn handle(&self, req: TusRequest) -> TusResponse
pub async fn handle(&self, req: TusRequest) -> TusResponse
Main dispatch — routes to the appropriate sub-handler.
Auto Trait Implementations§
impl<S, L> Freeze for TusHandler<S, L>
impl<S, L = NoLocker> !RefUnwindSafe for TusHandler<S, L>
impl<S, L> Send for TusHandler<S, L>
impl<S, L> Sync for TusHandler<S, L>
impl<S, L> Unpin for TusHandler<S, L>
impl<S, L> UnsafeUnpin for TusHandler<S, L>where
S: UnsafeUnpin,
L: UnsafeUnpin,
impl<S, L = NoLocker> !UnwindSafe for TusHandler<S, L>
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