ASKit

Struct ASKit 

Source
pub struct ASKit { /* private fields */ }

Implementations§

Source§

impl ASKit

Source

pub fn new() -> Self

Source

pub fn init() -> Result<Self, AgentError>

Source

pub async fn ready(&self) -> Result<(), AgentError>

Source

pub fn quit(&self)

Source

pub fn register_agent_definiton(&self, def: AgentDefinition)

Source

pub fn get_agent_definitions(&self) -> AgentDefinitions

Source

pub fn get_agent_definition(&self, def_name: &str) -> Option<AgentDefinition>

Source

pub fn get_agent_config_specs(&self, def_name: &str) -> Option<AgentConfigSpecs>

Source

pub fn get_agent_spec(&self, agent_id: &str) -> Option<AgentSpec>

Source

pub fn get_agent_stream_info(&self, id: &str) -> Option<AgentStreamInfo>

Get info of the agent stream by id.

Source

pub fn get_agent_stream_infos(&self) -> Vec<AgentStreamInfo>

Get infos of all agent streams.

Source

pub fn get_agent_stream_spec(&self, id: &str) -> Option<AgentStreamSpec>

Get the agent stream spec by id.

Source

pub fn set_agent_stream_spec( &self, id: &str, spec: AgentStreamSpec, ) -> Result<(), AgentError>

Set the agent stream spec by id.

Source

pub fn new_agent_stream(&self, name: &str) -> Result<String, AgentError>

Create a new agent stream with the given name. If the name already exists, a unique name will be generated by appending a number suffix. Returns the id of the new agent stream.

Source

pub fn rename_agent_stream( &self, id: &str, new_name: &str, ) -> Result<String, AgentError>

Source

pub fn unique_stream_name(&self, name: &str) -> String

Source

pub fn add_agent_stream( &self, name: String, spec: AgentStreamSpec, ) -> Result<String, AgentError>

Source

pub async fn remove_agent_stream(&self, id: &str) -> Result<(), AgentError>

Source

pub fn copy_sub_stream( &self, agents: &Vec<AgentSpec>, channels: &Vec<ChannelSpec>, ) -> (Vec<AgentSpec>, Vec<ChannelSpec>)

Source

pub async fn start_agent_stream(&self, id: &str) -> Result<(), AgentError>

Source

pub async fn stop_agent_stream(&self, id: &str) -> Result<(), AgentError>

Source

pub fn new_agent_spec(&self, def_name: &str) -> Result<AgentSpec, AgentError>

Create a new agent spec from the given agent definition name.

Source

pub fn add_agent( &self, stream_id: String, spec: AgentSpec, ) -> Result<(), AgentError>

Add an agent to the specified stream.

Source

pub fn get_agent( &self, agent_id: &str, ) -> Option<Arc<AsyncMutex<Box<dyn Agent>>>>

Get the agent by id.

Source

pub fn add_channel( &self, stream_id: &str, channel: ChannelSpec, ) -> Result<(), AgentError>

Source

pub async fn remove_agent( &self, stream_id: &str, agent_id: &str, ) -> Result<(), AgentError>

Source

pub fn remove_channel( &self, stream_id: &str, channel_id: &str, ) -> Result<(), AgentError>

Source

pub async fn start_agent(&self, agent_id: &str) -> Result<(), AgentError>

Source

pub async fn stop_agent(&self, agent_id: &str) -> Result<(), AgentError>

Source

pub async fn set_agent_configs( &self, agent_id: String, configs: AgentConfigs, ) -> Result<(), AgentError>

Source

pub fn get_global_configs(&self, def_name: &str) -> Option<AgentConfigs>

Source

pub fn set_global_configs(&self, def_name: String, configs: AgentConfigs)

Source

pub fn get_global_configs_map(&self) -> AgentConfigsMap

Source

pub fn set_global_configs_map(&self, new_configs_map: AgentConfigsMap)

Source

pub async fn agent_input( &self, agent_id: String, ctx: AgentContext, pin: String, value: AgentValue, ) -> Result<(), AgentError>

Source

pub async fn send_agent_out( &self, agent_id: String, ctx: AgentContext, pin: String, value: AgentValue, ) -> Result<(), AgentError>

Source

pub fn try_send_agent_out( &self, agent_id: String, ctx: AgentContext, pin: String, value: AgentValue, ) -> Result<(), AgentError>

Source

pub fn write_board_value( &self, name: String, value: AgentValue, ) -> Result<(), AgentError>

Source

pub fn write_var_value( &self, stream_id: &str, name: &str, value: AgentValue, ) -> Result<(), AgentError>

Source

pub fn subscribe(&self, observer: Box<dyn ASKitObserver + Sync + Send>) -> usize

Source

pub fn unsubscribe(&self, observer_id: usize)

Trait Implementations§

Source§

impl Clone for ASKit

Source§

fn clone(&self) -> ASKit

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for ASKit

§

impl RefUnwindSafe for ASKit

§

impl Send for ASKit

§

impl Sync for ASKit

§

impl Unpin for ASKit

§

impl UnwindSafe for ASKit

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: FloatComponent, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default
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<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
Source§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

Source§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
Source§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
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, Dst> ConvAsUtil<Dst> for T

Source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
Source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
Source§

impl<T> ConvUtil for T

Source§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
Source§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
Source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
Source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
Source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
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, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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<Src> TryFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
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<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

Source§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
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<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<Src> ValueFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
Source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

Source§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.