pub struct Task { /* private fields */ }Expand description
A function’s command metadata and generated invocation adapter.
Implementations§
Source§impl Task
impl Task
pub fn new( name: impl Into<String>, description: impl Into<String>, parameters: Vec<Parameter>, invoke: fn(&mut Context, &Arguments) -> Result<Value>, ) -> Self
Sourcepub fn handles_output(self) -> Self
pub fn handles_output(self) -> Self
Mark a task as responsible for its own user-facing output.
pub fn name(&self) -> &str
pub fn description(&self) -> &str
pub fn parameters(&self) -> &[Parameter]
pub fn produces_output(&self) -> bool
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnsafeUnpin for Task
impl UnwindSafe for Task
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