Struct Executable

Source
pub struct Executable<T>
where T: Task,
{ pub task: T, /* private fields */ }
Expand description

The wrapped task itself

Fields§

§task: T

Implementations§

Source§

impl<T> Executable<T>
where T: 'static + Task + Send + Debug,

Source

pub fn new<Id>(shared: SharedProject, task: T, task_id: Id) -> Executable<T>
where Id: AsRef<TaskId>,

Source

pub fn initialize( &mut self, project: &Project, ) -> Result<(), PayloadError<ProjectError>>

Initialize the executable.

Source

pub fn configure_io(&mut self) -> Result<(), PayloadError<ProjectError>>

Configures the io of this executable. Ran after the task is initialized.

Source

pub fn depends_on<B>(&mut self, buildable: B)
where B: IntoBuildable, <B as IntoBuildable>::Buildable: 'static,

Source

pub fn do_first<F>(&mut self, a: F) -> Result<(), PayloadError<ProjectError>>
where F: Fn(&mut Executable<T>, &Project) -> Result<(), PayloadError<BuildException>> + 'static + Send + Sync,

Source

pub fn do_last<F>(&mut self, a: F) -> Result<(), PayloadError<ProjectError>>
where F: Fn(&mut Executable<T>, &Project) -> Result<(), PayloadError<BuildException>> + 'static + Send + Sync,

Source

pub fn project(&self) -> SharedProject

Source

pub fn work(&mut self) -> &mut WorkHandler

Source

pub fn set_description(&mut self, description: &str)

Source

pub fn set_group(&mut self, group: &str)

Source

pub fn up_to_date<F>(&mut self, configure: F)
where F: Fn(&Executable<T>) -> bool + Send + Sync + 'static,

Add an up-to-date check

Trait Implementations§

Source§

impl<T> BuildableTask for Executable<T>
where T: 'static + Task + Send + Debug,

Source§

fn ordering(&self) -> Vec<TaskOrdering>

Gets the total ordering associated with the task. This includes all types of ordering, including those that aren’t strict dependencies. Read more
Source§

fn built_by(&self) -> BuiltByContainer

Gets the tasks that this task depends on
Source§

impl<T> Debug for Executable<T>
where T: Task + Debug,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<AT> Dependency for Executable<AT>
where AT: ArtifactTask,

Source§

fn id(&self) -> String

A way of identifying dependencies
Source§

fn dep_type(&self) -> DependencyType

The type of the dependency
Source§

fn try_resolve( &self, _: &dyn Registry, _: &Path, ) -> Result<ResolvedDependency, AcquisitionError>

Try to resolve a dependency in a registry. The cache_path is somewhere to write files into if necessary.
Source§

impl<T> Deref for Executable<T>
where T: Task,

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<Executable<T> as Deref>::Target

Dereferences the value.
Source§

impl<T> DerefMut for Executable<T>
where T: Task,

Source§

fn deref_mut(&mut self) -> &mut <Executable<T> as Deref>::Target

Mutably dereferences the value.
Source§

impl<T> ExecutableTask for Executable<T>
where T: 'static + Task + Send + Sync + Debug,

Source§

fn options_declarations(&self) -> Option<OptionDeclarations>

Get the options declaration for this task
Source§

fn try_set_from_decoder( &mut self, decoder: &OptionsDecoder<'_>, ) -> Result<(), PayloadError<ProjectError>>

Try to set values from a decoder
Source§

fn execute( &mut self, project: &Project, ) -> Result<(), PayloadError<BuildException>>

Executes the task, with a given project
Source§

fn did_work(&self) -> bool

Checks if this task did work
Source§

fn task_up_to_date(&self) -> bool

Check if this task marked itself as up to date
Source§

fn group(&self) -> String

Gets the group of the task
Source§

fn description(&self) -> String

Gets the description of the task
Source§

impl<AT> GetBuildable for Executable<AT>
where AT: ArtifactTask,

Source§

fn as_buildable(&self) -> BuildableObject

Returns a dependency which contains the tasks which build this object.
Source§

impl<T> HasTaskId for Executable<T>
where T: 'static + Task + Send + Debug,

Source§

fn task_id(&self) -> TaskId

Gets the task id
Source§

impl<T> IntoBuildable for &Executable<T>
where T: Task + Send + Debug,

Source§

type Buildable = BuiltByContainer

Source§

fn into_buildable(self) -> <&Executable<T> as IntoBuildable>::Buildable

Returns a dependency which contains the tasks which build this object.

Auto Trait Implementations§

§

impl<T> !Freeze for Executable<T>

§

impl<T> !RefUnwindSafe for Executable<T>

§

impl<T> Send for Executable<T>
where T: Send,

§

impl<T> Sync for Executable<T>
where T: Sync,

§

impl<T> Unpin for Executable<T>
where T: Unpin,

§

impl<T> !UnwindSafe for Executable<T>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn instance_of<T>(&self) -> bool
where T: Any + ?Sized,

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<D> IntoDependency for D
where D: Dependency,

Source§

type IntoDep = D

Source§

fn into_dependency(self) -> <D as IntoDependency>::IntoDep

Turn this type into a dependency
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> IntoNamed for T

Source§

fn named<S>(self, name: S) -> Named<Self>
where S: AsRef<str>,

Add a name to this object
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<E> Extension for E
where E: 'static + Send + Sync,

Source§

impl<T> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,

Source§

impl<F> FullTask for F

Source§

impl<T> MaybeSendSync for T