Skip to main content

FluxManager

Struct FluxManager 

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

FLUX transference manager

Implementations§

Source§

impl FluxManager

Source

pub fn new() -> Self

Source

pub fn create_flux( &mut self, source: RoomId, target: RoomId, timestamp: f64, payload: TransferencePayload, zeitgeist: Zeitgeist, ) -> FluxTransference

Create a FLUX transference from source to target

Source

pub fn send_flux(&mut self, flux: FluxTransference)

Send a FLUX transference (queue it)

Source

pub fn recv_flux_for(&mut self, target: &RoomId) -> Vec<FluxTransference>

Receive pending FLUX transferences for a target room

Source

pub fn recv_flux(&mut self) -> Option<FluxTransference>

Receive any pending FLUX transference

Source

pub fn update_parity( &mut self, room: &RoomId, zeitgeist: &Zeitgeist, timestamp: f64, )

Update parity state for a room (CONSTRAINT 7)

Source

pub fn check_parity(&self, room: &RoomId) -> bool

Check if a room has valid parity (CONSTRAINT 7)

Source

pub fn encode_zeitgeist(zeitgeist: &Zeitgeist) -> Vec<u8>

Encode zeitgeist to bytes (simplified CBOR-like format)

Source

pub fn decode_zeitgeist(bytes: &[u8]) -> Result<Zeitgeist, String>

Decode zeitgeist from bytes

Source

pub fn track_funnel( &self, zeitgeist: &Zeitgeist, observations: &[f64], ) -> FunnelState

Track deadband funnel for precision convergence

Source

pub fn pending_count(&self) -> usize

Pending count

Trait Implementations§

Source§

impl Default for FluxManager

Source§

fn default() -> Self

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

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