Struct ClusterClient

Source
pub struct ClusterClient { /* private fields */ }
Expand description

Client for interacting with a cluster

Implementations§

Source§

impl ClusterClient

Source

pub fn new( cmd_tx: Sender<SubnetCommand>, event_rx: Receiver<SubnetEvent>, ) -> Self

Source

pub const fn available_patterns(&self) -> &HashMap<String, Pattern>

returns an immutable reference to the available patterns

Source

pub fn available_patterns_mut(&mut self) -> &mut HashMap<String, Pattern>

returns a mutable reference to the available patterns

Source

pub fn client_id(&self) -> &str

returns the id of the client

Source

pub const fn peers(&self) -> &HashMap<NodeId, PeerInfo>

returns an immutable reference to the peers

Source

pub fn peers_mut(&mut self) -> &mut HashMap<NodeId, PeerInfo>

returns a mutable reference to the peers

Source

pub async fn find_learning_nodes(&self) -> Vec<NodeId>

Find nodes that can learn patterns

Source

pub fn get_patterns_for_class(&self, class: Triads) -> Vec<&Pattern>

Get patterns for a specific chord class

Source

pub fn get_peers(&self) -> &HashMap<NodeId, PeerInfo>

Get all known peers with their capabilities

Source

pub fn get_peers_with_capability( &self, capability: &str, ) -> Vec<(NodeId, &PeerInfo)>

Get peers with a specific capability

Source

pub async fn process_events(&mut self) -> Result<()>

Process received events from the cluster

Source

pub async fn share_pattern( &self, node_id: NodeId, chord_class: Triads, input: [f32; 3], output: f32, ) -> Result<(), NetworkError>

Share a specific pattern with the network

Source

pub async fn request_pattern_sharing(&self) -> Result<(), NetworkError>

Request all nodes to share their patterns

Source

pub async fn connect(&self, addr: Multiaddr) -> Result<NodeId, NetworkError>

Connect to a peer address

Source

pub async fn request_resource_status(&self) -> Result<(), NetworkError>

Request resource status from all peers

Source

pub async fn allocate_task( &self, task_type: String, work_units: Vec<WorkUnit>, ) -> Result<(), NetworkError>

Allocate work units to network nodes

Source

pub async fn learn_network_patterns(&self) -> Result<(), NetworkError>

Learn patterns that have been shared on the network

Source

pub async fn distribute_surface_patterns(&self) -> Result<(), NetworkError>

Distribute surface patterns to the network

Source

pub async fn form_processing_cluster( &self, task_type: String, ) -> Result<Vec<PeerId>, NetworkError>

Form a processing cluster for a specific task type

Source

pub async fn synchronize_memory(&self) -> Result<(), NetworkError>

Synchronize memory across the network

Source

pub async fn dynamic_work_distribution( &self, operations: Vec<(EdgeId, Vec<LPR>)>, ) -> Result<(), NetworkError>

Create a dynamic work distribution for a set of operations

Source

pub async fn topology_aware_learning(&self) -> Result<(), NetworkError>

Enable topology-aware learning

Source

pub async fn shutdown(&self) -> Result<(), NetworkError>

Shutdown the network

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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<Idx, T> IntoIndex<Idx> for T
where T: Into<Index<Idx>>,

Source§

fn into_index(self) -> Index<Idx>

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

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T