pub struct Handler<S, T, Compact> { /* private fields */ }Expand description
Handler struct for Actix web routes.
Implementations§
Source§impl<S, T, Compact> Handler<S, T, Compact>
impl<S, T, Compact> Handler<S, T, Compact>
Sourcepub async fn get_tasks(
storage: Data<RwLock<S>>,
query: Query<Filter>,
) -> impl Responder
pub async fn get_tasks( storage: Data<RwLock<S>>, query: Query<Filter>, ) -> impl Responder
Get tasks for a specific queue.
Sourcepub async fn stats_by_queue(storage: Data<RwLock<S>>) -> impl Responder
pub async fn stats_by_queue(storage: Data<RwLock<S>>) -> impl Responder
Get statistics for a specific queue.
Sourcepub async fn get_workers(storage: Data<RwLock<S>>) -> impl Responder
pub async fn get_workers(storage: Data<RwLock<S>>) -> impl Responder
Get workers for a specific queue.
Sourcepub async fn push_task(
task: Json<T>,
storage: Data<RwLock<S>>,
) -> impl Responderwhere
T: Serialize + DeserializeOwned + 'static,
S: TaskSink<T> + Send + BackendExt,
S::Error: Error,
S::Codec: Codec<T, Compact = Compact>,
<<S as BackendExt>::Codec as Codec<T>>::Error: Error,
pub async fn push_task(
task: Json<T>,
storage: Data<RwLock<S>>,
) -> impl Responderwhere
T: Serialize + DeserializeOwned + 'static,
S: TaskSink<T> + Send + BackendExt,
S::Error: Error,
S::Codec: Codec<T, Compact = Compact>,
<<S as BackendExt>::Codec as Codec<T>>::Error: Error,
Push a new task to the specified queue.
Sourcepub async fn get_task_by_id(
task_id: Path<String>,
storage: Data<RwLock<S>>,
) -> impl Responder
pub async fn get_task_by_id( task_id: Path<String>, storage: Data<RwLock<S>>, ) -> impl Responder
Get a task by its ID.
Sourcepub async fn get_all_tasks(
storage: Data<RwLock<S>>,
query: Query<Filter>,
) -> impl Responder
pub async fn get_all_tasks( storage: Data<RwLock<S>>, query: Query<Filter>, ) -> impl Responder
Get all tasks across all queues.
Sourcepub async fn get_all_workers(storage: Data<RwLock<S>>) -> impl Responder
pub async fn get_all_workers(storage: Data<RwLock<S>>) -> impl Responder
Get all workers across all queues.
Sourcepub async fn fetch_queues(storage: Data<RwLock<S>>) -> impl Responder
pub async fn fetch_queues(storage: Data<RwLock<S>>) -> impl Responder
Fetch all queues.
Trait Implementations§
Auto Trait Implementations§
impl<S, T, Compact> Freeze for Handler<S, T, Compact>
impl<S, T, Compact> RefUnwindSafe for Handler<S, T, Compact>
impl<S, T, Compact> Send for Handler<S, T, Compact>
impl<S, T, Compact> Sync for Handler<S, T, Compact>
impl<S, T, Compact> Unpin for Handler<S, T, Compact>
impl<S, T, Compact> UnsafeUnpin for Handler<S, T, Compact>
impl<S, T, Compact> UnwindSafe for Handler<S, T, Compact>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more