Struct TaskId

Source
pub struct TaskId(/* private fields */);
Expand description

How tasks are referenced throughout projects.

All tasks must have an associated TaskId.

Implementations§

Source§

impl TaskId

Source

pub fn new<S>(s: S) -> Result<TaskId, InvalidId>
where S: AsRef<str>,

Source

pub fn prop<T>(&self, name: &str) -> Result<Prop<T>, InvalidId>
where T: Clone + Send + Sync + 'static,

Creates a new empty property. Does not register said property

Source

pub fn vec_prop<T>(&self, name: &str) -> Result<VecProp<T>, InvalidId>
where T: Clone + Send + Sync + 'static,

Creates a new vec property. Does not register said property

Source

pub fn project_id(&self) -> Option<ProjectId>

Gets the project id that contains this task.

Methods from Deref<Target = Id>§

Source

pub fn join<S>(&self, next: S) -> Result<Id, InvalidId>
where S: AsRef<str>,

Joins something that can be turned into an identifier to the end of this Id.

§Error

Errors if the next is not a valid identifier

Source

pub fn concat<I>(&self, other: I) -> Id
where I: Into<Id>,

Concatenate two Id’s together

Source

pub fn this(&self) -> &str

Returns this part of an identifier path.

Source

pub fn this_id(&self) -> Id

Returns this part of an identifier path as an Id

Source

pub fn parent(&self) -> Option<&Id>

Returns the parent identifier of this id, if it exists.

Source

pub fn is_shorthand(&self, repr: &str) -> bool

Check if the given representation is a valid shorthand.

Source

pub fn is_shorthand_this(&self, repr: &str) -> bool

Source

pub fn ancestors(&self) -> impl Iterator<Item = &Id>

Gets the ancestors of this id.

For example, the ancestors of root:inner:task would be

  • root:inner:task
  • root:inner
  • root
Source

pub fn iter(&self) -> Iter<'_>

Source

pub fn as_path(&self) -> PathBuf

Trait Implementations§

Source§

impl AsRef<TaskId> for TaskId

Source§

fn as_ref(&self) -> &TaskId

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Buildable for TaskId

Source§

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

Gets the dependencies required to build this task
Source§

impl Clone for TaskId

Source§

fn clone(&self) -> TaskId

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 Debug for TaskId

Source§

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

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

impl Default for TaskId

Source§

fn default() -> TaskId

Returns the “default value” for a type. Read more
Source§

impl Deref for TaskId

Source§

type Target = Id

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl<'de> Deserialize<'de> for TaskId

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<TaskId, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for TaskId

Source§

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

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

impl From<&TaskId> for TaskId

Source§

fn from(t: &TaskId) -> TaskId

Converts to this type from the input type.
Source§

impl From<Id> for TaskId

Source§

fn from(i: Id) -> TaskId

Converts to this type from the input type.
Source§

impl From<TaskId> for BuildableObject

Source§

fn from(c: TaskId) -> BuildableObject

Converts to this type from the input type.
Source§

impl From<TaskId> for Origin

Source§

fn from(t: TaskId) -> Origin

Converts to this type from the input type.
Source§

impl From<TaskId> for TaskPathBuf

Source§

fn from(value: TaskId) -> TaskPathBuf

Converts to this type from the input type.
Source§

impl FromStr for TaskId

Source§

fn from_str(s: &str) -> Result<TaskId, <TaskId as FromStr>::Err>

Parses a task ID. Unlike the TryFrom methods, this one can produced multi level ids

Source§

type Err = InvalidId

The associated error which can be returned from parsing.
Source§

impl Hash for TaskId

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<I> PartialEq<I> for TaskId
where Id: PartialEq<I>, I: ?Sized,

Source§

fn eq(&self, other: &I) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for TaskId

Source§

fn eq(&self, other: &TaskId) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TaskId

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<&str> for TaskId

Source§

type Error = InvalidId

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

fn try_from(value: &str) -> Result<TaskId, <TaskId as TryFrom<&str>>::Error>

Performs the conversion.
Source§

impl TryFrom<String> for TaskId

Source§

type Error = InvalidId

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

fn try_from(value: String) -> Result<TaskId, <TaskId as TryFrom<String>>::Error>

Performs the conversion.
Source§

impl Eq for TaskId

Source§

impl StructuralPartialEq for TaskId

Auto Trait Implementations§

§

impl Freeze for TaskId

§

impl RefUnwindSafe for TaskId

§

impl Send for TaskId

§

impl Sync for TaskId

§

impl Unpin for TaskId

§

impl UnwindSafe for TaskId

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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<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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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