Struct TaskProvider

Source
pub struct TaskProvider<T, R, F>
where T: Task + Send + Sync + Debug + 'static, F: Fn(&Executable<T>) -> R + Send + Sync, R: Clone + Send + Sync,
{ /* private fields */ }

Implementations§

Source§

impl<T, F, R> TaskProvider<T, R, F>
where T: Task + Send + Sync + Debug + 'static, F: Fn(&Executable<T>) -> R + Send + Sync, R: Clone + Send + Sync,

Source

pub fn new(handle: TaskHandle<T>, lift: F) -> TaskProvider<T, R, F>

Trait Implementations§

Source§

impl<T, F, R> Buildable for TaskProvider<T, R, F>
where F: Fn(&Executable<T>) -> R + Send + Sync, R: Clone + Send + Sync, T: 'static + Debug + Send + Task + Sync,

Source§

fn get_dependencies( &self, _: &Project, ) -> Result<HashSet<TaskId>, PayloadError<ProjectError>>

Gets the dependencies required to build this task
Source§

impl<T, R, F> Clone for TaskProvider<T, R, F>
where T: Task + Send + Sync + Debug + 'static, F: Fn(&Executable<T>) -> R + Send + Sync + Clone, R: Clone + Send + Sync,

Source§

fn clone(&self) -> TaskProvider<T, R, F>

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T, F, R> Debug for TaskProvider<T, R, F>
where F: Fn(&Executable<T>) -> R + Send + Sync, R: Clone + Send + Sync, T: 'static + Debug + Send + Task + Sync,

Source§

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

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

impl<T, F, R> Provider<R> for TaskProvider<T, R, F>
where T: Task + Send + Sync + Debug + 'static, F: Fn(&Executable<T>) -> R + Send + Sync, R: Clone + Send + Sync,

Source§

fn missing_message(&self) -> String

The missing message for this provider
Source§

fn try_get(&self) -> Option<R>

Try to get a value from the provider. Read more
Source§

fn fallible_get(&self) -> Result<R, ProviderError>

Tries to get a value from this provider, returning an error if not available. Read more
Source§

fn get(&self) -> T

Get a value from the provider. Read more

Auto Trait Implementations§

§

impl<T, R, F> Freeze for TaskProvider<T, R, F>
where F: Freeze,

§

impl<T, R, F> RefUnwindSafe for TaskProvider<T, R, F>
where F: RefUnwindSafe,

§

impl<T, R, F> Send for TaskProvider<T, R, F>

§

impl<T, R, F> Sync for TaskProvider<T, R, F>

§

impl<T, R, F> Unpin for TaskProvider<T, R, F>
where F: Unpin,

§

impl<T, R, F> UnwindSafe for TaskProvider<T, R, F>
where F: 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<B> GetBuildable for B
where B: IntoBuildable + Clone, <B as IntoBuildable>::Buildable: 'static,

Source§

fn as_buildable(&self) -> BuildableObject

Returns a dependency which contains the tasks which build this object.
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<B> IntoBuildable for B
where B: Buildable,

Source§

type Buildable = B

Source§

fn into_buildable(self) -> B

Returns a dependency which contains the tasks which build this object.
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<P, T> IntoProvider<T> for P
where T: Clone + Send + Sync, P: Provider<T> + Send + Sync,

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> ProviderExt<T> for P
where T: Clone + Send + Sync, P: Provider<T> + Send + Sync + 'static,

Source§

fn map<R, F>(self, transform: F) -> Map<T, R, F, Self>
where R: Send + Sync + Clone, F: Fn(T) -> R + Send + Sync, Self: 'static,

Creates a provider that can map the output of one provider into some other value. Read more
Source§

fn flat_map<R, P, F>(self, transform: F) -> FlatMap<T, R, Self, P, F>
where R: Send + Sync + Clone, P: Provider<R>, F: Fn(T) -> P + Send + Sync,

Creates a provider that can map the output of one provider with type T into some other value that’s also a provider of type R. The created provider is a provider of type R Read more
Source§

fn flatten<B>(self) -> FlatMap<T, B, Self, T, fn(T) -> T>
where Self: Clone + 'static, T: Provider<B>, B: Clone + Send + Sync,

Flattens a provider that provides another provider
Source§

fn zip<P, B, R, F>(self, other: P, func: F) -> Zip<T, B, R, F>
where Self: 'static, P: IntoProvider<B>, <P as IntoProvider<B>>::Provider: 'static, B: Send + Sync + Clone, R: Send + Sync + Clone, F: Fn(T, B) -> R + Send + Sync,

Creates a provider that can map the output of two provider with type T1 and T2 into some other value and transforms the two values into one output value of type B. 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<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> MaybeSendSync for T