Skip to main content

MiniNode

Struct MiniNode 

Source
pub struct MiniNode<S: MiniNodeStore> { /* private fields */ }

Implementations§

Source§

impl<S: MiniNodeStore> MiniNode<S>

Source

pub fn load_or_create<R: CryptoRngCore + Copy>( rng: R, config: MiniNodeConfig, store: S, ) -> Result<Self, MiniNodeError>

Source

pub fn new_with_identity( identity: PrivateIdentity, config: MiniNodeConfig, store: S, snapshot: NodeSnapshot, ) -> Self

Source

pub fn tick<R: CryptoRngCore + Copy, L: FrameLink>( &mut self, now_ms: u64, rng: R, link: &mut L, ) -> Result<(), MiniNodeError>

Source

pub fn destination_hash(&self) -> [u8; 16]

Source

pub fn identity(&self) -> &PrivateIdentity

Source

pub fn neighbors(&self) -> impl Iterator<Item = &NeighborRecord>

Source

pub fn poll_event(&mut self) -> Option<NodeEvent>

Source

pub fn queue_announce<R: CryptoRngCore + Copy>( &mut self, now_ms: u64, rng: R, app_data: Option<&[u8]>, ) -> Result<(), MiniNodeError>

Source

pub fn send_message( &mut self, destination_hash: [u8; 16], content: &[u8], ) -> Result<MessageEnvelope, MiniNodeError>

Source

pub fn send_message_with_latest_telemetry( &mut self, destination_hash: [u8; 16], content: &[u8], limit: usize, ) -> Result<MessageEnvelope, MiniNodeError>

Source

pub fn record_telemetry( &mut self, sample: TelemetrySample, ) -> Result<(), MiniNodeError>

Source

pub fn query_telemetry(&self, query: &TelemetryQuery) -> Vec<TelemetryPoint>

Auto Trait Implementations§

§

impl<S> Freeze for MiniNode<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for MiniNode<S>
where S: RefUnwindSafe,

§

impl<S> Send for MiniNode<S>
where S: Send,

§

impl<S> Sync for MiniNode<S>
where S: Sync,

§

impl<S> Unpin for MiniNode<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for MiniNode<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for MiniNode<S>
where S: UnwindSafe,

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.