[−][src]Struct installer::installation::Task
this structure is a container for a task, or rather an abstraction over a series of steps in the installation process this struct is stored and used by the taskschedule struct, that is responsible for running tasks in parrallel perhaps it would have been easier to use async await I don't know
Implementations
impl<E: Error + Send + Sync, DB: Database<E> + Send + Sync> Task<E, DB>
[src]
pub fn new<F>(task_id: u16, name: &str, func: F) -> Self where
F: Fn(Arc<DB>, Arc<Mutex<Vec<(String, u16)>>>) -> Result<(), Box<dyn Error + Send + Sync>> + 'static + Send + Sync,
[src]
F: Fn(Arc<DB>, Arc<Mutex<Vec<(String, u16)>>>) -> Result<(), Box<dyn Error + Send + Sync>> + 'static + Send + Sync,
create a task
Arguments
task id: some number that identifies a task name: the name of the task func: the closure that handles the code that is run in a given task
Example
let task = Task::new(0, "random task", mvoe |db|{ // run some code in here Ok(()) }); task.run().unwrap();
pub fn run(
self,
database: Arc<DB>,
completed: Arc<Mutex<Vec<(String, u16)>>>
) -> Result<(String, u16), ((String, u16), Box<dyn Error + Send + Sync>)>
[src]
self,
database: Arc<DB>,
completed: Arc<Mutex<Vec<(String, u16)>>>
) -> Result<(String, u16), ((String, u16), Box<dyn Error + Send + Sync>)>
pub fn name(&self) -> String
[src]
pub fn id(&self) -> u16
[src]
Trait Implementations
impl<E: Clone + Error + Send + Sync, DB: Clone + Database<E> + Send + Sync> Clone for Task<E, DB>
[src]
impl<E: Error + Send + Sync, DB: Database<E> + Send + Sync> Debug for Task<E, DB>
[src]
Auto Trait Implementations
impl<E, DB> !RefUnwindSafe for Task<E, DB>
impl<E, DB> Send for Task<E, DB>
impl<E, DB> Sync for Task<E, DB>
impl<E, DB> Unpin for Task<E, DB> where
E: Unpin,
E: Unpin,
impl<E, DB> !UnwindSafe for Task<E, DB>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,