pub struct ExecutionContext {
pub state: ExecutionState,
pub strategy: ExecutionStrategy,
pub device: DeviceType,
pub profile_data: Option<ProfileData>,
pub metadata: HashMap<String, String>,
/* private fields */
}Expand description
Execution context for coordinated execution
Fields§
§state: ExecutionState§strategy: ExecutionStrategy§device: DeviceType§profile_data: Option<ProfileData>§metadata: HashMap<String, String>Implementations§
Source§impl ExecutionContext
impl ExecutionContext
pub fn new(total_nodes: usize, strategy: ExecutionStrategy) -> Self
pub fn with_device(self, device: DeviceType) -> Self
pub fn with_profiling(self, enable: bool) -> Self
pub fn add_hook(&mut self, hook: Box<dyn ExecutionHook>)
pub fn set_metadata(&mut self, key: impl Into<String>, value: impl Into<String>)
pub fn get_metadata(&self, key: &str) -> Option<&str>
pub fn start(&mut self)
pub fn complete(&mut self)
pub fn fail(&mut self, error: impl Into<String>)
pub fn cancel(&mut self)
pub fn begin_node(&mut self, node_idx: usize)
pub fn end_node(&mut self, node_idx: usize, duration: Duration)
pub fn summary(&self) -> String
Auto Trait Implementations§
impl Freeze for ExecutionContext
impl !RefUnwindSafe for ExecutionContext
impl Send for ExecutionContext
impl !Sync for ExecutionContext
impl Unpin for ExecutionContext
impl UnsafeUnpin for ExecutionContext
impl !UnwindSafe for ExecutionContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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