Skip to main content

AI3Engine

Struct AI3Engine 

Source
pub struct AI3Engine {
    pub task_distributor: TaskDistributor,
    /* private fields */
}
Expand description

Main AI3 engine: coordinates tensor operations and mining tasks (Ported from .AI3 ai3-lib with PoT-O extensions).

Fields§

§task_distributor: TaskDistributor

Distributor for mining tasks.

Implementations§

Source§

impl AI3Engine

Source

pub fn new() -> Self

Source

pub fn with_config(config: EngineConfig) -> Self

Source

pub fn execute_task(&self, task: &MiningTask) -> TribeResult<Tensor>

Execute a tensor operation from a mining task and return the result tensor.

Source

pub fn get_stats(&self) -> EngineStats

Returns current engine statistics.

Source

pub fn record_result(&self, success: bool, duration: Duration)

Records a task result for statistics.

Trait Implementations§

Source§

impl Default for AI3Engine

Source§

fn default() -> Self

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

impl TensorEngine for AI3Engine

Source§

fn execute_task(&self, task: &MiningTask) -> TribeResult<Tensor>

Source§

fn get_stats(&self) -> EngineStats

Source§

fn record_result(&self, success: bool, duration: Duration)

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.