Skip to main content

Handler

Struct Handler 

Source
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>

Source

pub async fn get_tasks( storage: Data<RwLock<S>>, query: Query<Filter>, ) -> impl Responder
where T: Serialize + DeserializeOwned + 'static, S: ListTasks<T> + Send + 'static + BackendExt, S::Context: Serialize + 'static, S::IdType: Serialize + 'static, <S as Backend>::Error: Error + 'static, S::Codec: Codec<T, Compact = Compact> + 'static, Compact: 'static,

Get tasks for a specific queue.

Source

pub async fn stats_by_queue(storage: Data<RwLock<S>>) -> impl Responder
where S::Error: Error, S: Metrics + BackendExt,

Get statistics for a specific queue.

Source

pub async fn get_workers(storage: Data<RwLock<S>>) -> impl Responder

Get workers for a specific queue.

Source

pub async fn push_task( task: Json<T>, storage: Data<RwLock<S>>, ) -> impl Responder
where 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.

Source

pub async fn get_task_by_id( task_id: Path<String>, storage: Data<RwLock<S>>, ) -> impl Responder
where T: Serialize + DeserializeOwned + 'static, S: FetchById<T> + 'static, S::Context: Serialize, S::IdType: Serialize + FromStr, S::Error: Error, <<S as Backend>::IdType as FromStr>::Err: Error,

Get a task by its ID.

Source

pub async fn get_all_tasks( storage: Data<RwLock<S>>, query: Query<Filter>, ) -> impl Responder

Get all tasks across all queues.

Source

pub async fn get_all_workers(storage: Data<RwLock<S>>) -> impl Responder
where S: ListWorkers, S::Error: Error,

Get all workers across all queues.

Source

pub async fn fetch_queues(storage: Data<RwLock<S>>) -> impl Responder
where S::Error: Error, S: ListQueues,

Fetch all queues.

Source

pub async fn overview(storage: Data<RwLock<S>>) -> impl Responder
where S::Error: Error, S: Metrics,

Get an overview of statistics.

Trait Implementations§

Source§

impl<S: Clone, T: Clone, Compact: Clone> Clone for Handler<S, T, Compact>

Source§

fn clone(&self) -> Handler<S, T, Compact>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S: Debug, T: Debug, Compact: Debug> Debug for Handler<S, T, Compact>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S, T, Compact> Freeze for Handler<S, T, Compact>

§

impl<S, T, Compact> RefUnwindSafe for Handler<S, T, Compact>
where S: RefUnwindSafe, T: RefUnwindSafe, Compact: RefUnwindSafe,

§

impl<S, T, Compact> Send for Handler<S, T, Compact>
where S: Send, T: Send, Compact: Send,

§

impl<S, T, Compact> Sync for Handler<S, T, Compact>
where S: Sync, T: Sync, Compact: Sync,

§

impl<S, T, Compact> Unpin for Handler<S, T, Compact>
where S: Unpin, T: Unpin, Compact: Unpin,

§

impl<S, T, Compact> UnsafeUnpin for Handler<S, T, Compact>

§

impl<S, T, Compact> UnwindSafe for Handler<S, T, Compact>
where S: UnwindSafe, T: UnwindSafe, Compact: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more