Struct orchestrator::orchestrator::OrchestratorReference

source ·
pub struct OrchestratorReference<S: ExecutorGlobalState> { /* private fields */ }
Expand description

A shared reference to the orchestrator

Methods from Deref<Target = Orchestrator<S>>§

source

pub async fn process_exercise( &self, name: String, source: String, user: User<Authenticated>, ) -> Result<ExerciseResult, DynError>

process the given exercise (name), and deliver the source (s). it gives back an ExerciseResult if all is gone well

source

pub async fn add_exercise<ExerciseType: ExerciseDef + ExecutorState>( &self, name: &str, source: &str, ) -> Result<(), DynError>

add exercise, Then tries to do a normal execution, and check if it does indeed return full score if not returns an error (and obviusly doesn’t add it)

source

pub async fn run_state(&self, cur: S) -> Result<S, DynError>

get and execute plan

source

pub async fn get_exercise_info( &self, name: String, ) -> Result<Box<dyn ExerciseDef>, DynError>

source

pub fn memory(&self) -> &dyn Memory<S>

get a reference to the internal memory

Trait Implementations§

source§

impl<S: Clone + ExecutorGlobalState> Clone for OrchestratorReference<S>

source§

fn clone(&self) -> OrchestratorReference<S>

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<S: ExecutorGlobalState> Deref for OrchestratorReference<S>

§

type Target = Orchestrator<S>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<S: ExecutorGlobalState> ReferenceWithoutState for OrchestratorReference<S>

source§

fn memory(&self) -> &dyn StatelessMemory

returns a memory reference (without state)
source§

fn process_exercise<'life0, 'async_trait>( &'life0 self, name: String, s: String, user: User<Authenticated>, ) -> Pin<Box<dyn Future<Output = Result<ExerciseResult, DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

from exercise name, source string, and user authenticated

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§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V