Skip to main content

Node

Struct Node 

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

ELARA Node - the runtime entity

Implementations§

Source§

impl Node

Source

pub fn new() -> Self

Create a new node with generated identity

Source

pub fn with_config(config: NodeConfig) -> Self

Create a new node with custom configuration

Source

pub fn with_identity(identity: Identity, config: NodeConfig) -> Self

Source

pub fn node_id(&self) -> NodeId

Get node ID

Source

pub fn session_id(&self) -> Option<SessionId>

Get session ID (if in session)

Source

pub fn join_session(&mut self, session_id: SessionId, session_key: [u8; 32])

Join a session

Source

pub fn join_session_unsecured(&mut self, session_id: SessionId)

Source

pub fn leave_session(&mut self)

Leave current session

Source

pub fn queue_incoming(&mut self, frame: Frame)

Queue an incoming frame for processing

Source

pub fn pop_outgoing(&mut self) -> Option<Frame>

Get next outgoing frame (if any)

Source

pub fn queue_local_event(&mut self, event: Event)

Queue a local event to send

Source

pub fn queue_visual_keyframe(&mut self, state: &VisualState)

Source

pub fn queue_visual_delta(&mut self, state: &VisualState)

Source

pub fn queue_stream_visual_keyframe( &mut self, stream_id: u64, state: &VisualState, )

Source

pub fn queue_stream_visual_delta(&mut self, stream_id: u64, state: &VisualState)

Source

pub fn queue_stream_start( &mut self, stream_id: u64, metadata: Vec<u8>, timestamp: StateTime, )

Source

pub fn queue_stream_end(&mut self, stream_id: u64, timestamp: StateTime)

Source

pub fn queue_feed_append( &mut self, feed_state: StateId, data: Vec<u8>, timestamp: StateTime, )

Source

pub fn queue_feed_delete(&mut self, feed_state: StateId, timestamp: StateTime)

Source

pub fn tick(&mut self)

Execute one tick of the runtime loop This is the core 12-stage loop

Source

pub fn visual_state(&self, node_id: NodeId) -> Option<VisualState>

Source

pub fn visual_state_at( &mut self, node_id: NodeId, target_time: StateTime, ) -> Option<VisualState>

Source

pub fn visual_state_now(&mut self, node_id: NodeId) -> Option<VisualState>

Source

pub fn stream_visual_state(&self, stream_id: u64) -> Option<VisualState>

Source

pub fn stream_visual_state_at( &mut self, stream_id: u64, target_time: StateTime, ) -> Option<VisualState>

Source

pub fn stream_visual_state_now(&mut self, stream_id: u64) -> Option<VisualState>

Source

pub fn feed_stream(&self, feed_state: StateId) -> FeedStream

Source

pub fn stream_metadata(&self, stream_id: u64) -> Option<&StreamMetadata>

Source

pub fn time_engine(&self) -> &TimeEngine

Get reference to time engine

Source

pub fn state_engine(&self) -> &ReconciliationEngine

Get reference to state engine

Source

pub fn state_engine_mut(&mut self) -> &mut ReconciliationEngine

Get mutable reference to state engine

Source

pub fn stats(&self) -> &RuntimeStats

Source

pub fn in_session(&self) -> bool

Check if node is in a session

Source

pub fn next_event_seq(&mut self) -> u64

Get next event sequence number

Trait Implementations§

Source§

impl Default for Node

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Node

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

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

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

Source§

fn vzip(self) -> V