Struct SharedProject

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

The shared project allows for many projects to share references to the same Project instance.

Implementations§

Source§

impl SharedProject

Source

pub fn with<F, R>(&self, func: F) -> R
where F: FnOnce(&Project) -> R,

Source

pub fn with_mut<F, R>(&self, func: F) -> R
where F: FnOnce(&mut Project) -> R,

Source

pub fn guard<'g, T, F>( &'g self, func: F, ) -> Result<Guard<'g, T>, PayloadError<ProjectError>>
where F: Fn(&Project) -> &T + 'g,

Source

pub fn guard_mut<'g, T, F1, F2>( &'g self, ref_getter: F1, mut_getter: F2, ) -> Result<GuardMut<'g, T>, PayloadError<ProjectError>>
where F1: Fn(&Project) -> &T + 'g, F2: Fn(&mut Project) -> &mut T + 'g,

Source

pub fn tasks(&self) -> GuardMut<'_, TaskContainer>

Source

pub fn register_task<T>( &self, id: &str, ) -> Result<TaskHandle<T>, PayloadError<ProjectError>>
where T: Task + Send + Sync + Debug + 'static,

Source

pub fn get_task( &self, id: &TaskId, ) -> Result<AnyTaskHandle, PayloadError<ProjectError>>

Gets a task with a given name

Source

pub fn get_typed_task<T>( &self, id: &TaskId, ) -> Result<TaskHandle<T>, PayloadError<ProjectError>>
where T: Task + Send + Sync,

Gets a typed task

Source

pub fn find_task<P>( &self, path: P, ) -> Result<AnyTaskHandle, PayloadError<ProjectError>>
where P: AsRef<TaskPath>,

Finds a task, using this project as the base task

Source

pub fn get_subproject<P>( &self, project: P, ) -> Result<SharedProject, PayloadError<ProjectError>>
where P: AsRef<str>,

Source

pub fn allprojects<F>(&self, callback: F)
where F: Fn(&Project) + Clone,

Executes a callback on this project and all sub projects

Source

pub fn allprojects_mut<F>(&self, callback: F)
where F: Fn(&mut Project) + Clone,

Executes a callback on this project and all sub projects

Source

pub fn task_container(&self) -> Guard<'_, TaskContainer>

Gets the task container for this project

Source

pub fn registries<F, R>(&self, func: F) -> R
where F: FnOnce(&mut RegistryContainer) -> R,

Get access to the registries container

Source

pub fn configurations_mut(&mut self) -> GuardMut<'_, ConfigurationHandler>

Get a guard to the dependency container within the project

Source

pub fn configurations(&self) -> Guard<'_, ConfigurationHandler>

Get a guard to the dependency container within the project

Source

pub fn workspace(&self) -> Guard<'_, Workspace>

Source

pub fn apply_plugin<P>(&self) -> Result<(), PayloadError<ProjectError>>
where P: Plugin<Project>,

Apply a plugin to this.

Trait Implementations§

Source§

impl Clone for SharedProject

Source§

fn clone(&self) -> SharedProject

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 CreateProjectDependencies for SharedProject

Source§

fn project<S>(&self, path: S) -> ProjectDependency
where S: AsRef<str>,

Creates an inter-project dependency with the default configuration
Source§

fn project_with<P, C>(&self, path: P, config: C) -> ProjectDependency
where P: AsRef<str>, C: AsRef<str>,

Creates an inter-project dependency with a given configuration
Source§

impl Debug for SharedProject

Source§

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

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

impl Default for SharedProject

Source§

fn default() -> SharedProject

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

impl Display for SharedProject

Source§

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

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

impl From<Arc<(RwLock<RawRwLock, Project>, ProjectId)>> for SharedProject

Source§

fn from(arc: Arc<(RwLock<RawRwLock, Project>, ProjectId)>) -> SharedProject

Converts to this type from the input type.
Source§

impl GetProjectId for SharedProject

Source§

fn project_id(&self) -> ProjectId

Source§

fn parent_id(&self) -> Option<ProjectId>

Source§

fn root_id(&self) -> ProjectId

Source§

fn is_root(&self) -> bool

Get whether this project is a root
Source§

impl TryFrom<Weak<(RwLock<RawRwLock, Project>, ProjectId)>> for SharedProject

Source§

type Error = ()

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

fn try_from( value: Weak<(RwLock<RawRwLock, Project>, ProjectId)>, ) -> Result<SharedProject, <SharedProject as TryFrom<Weak<(RwLock<RawRwLock, Project>, ProjectId)>>>::Error>

Performs the conversion.
Source§

impl TryFrom<WeakSharedProject> for SharedProject

Source§

type Error = PayloadError<ProjectError>

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

fn try_from( value: WeakSharedProject, ) -> Result<SharedProject, <SharedProject as TryFrom<WeakSharedProject>>::Error>

Performs the conversion.

Auto Trait Implementations§

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> 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<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<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> ErasedDestructor for T
where T: 'static,

Source§

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

Source§

impl<T> MaybeSendSync for T