Skip to main content

AnyPeer

Trait AnyPeer 

Source
pub trait AnyPeer {
    // Required methods
    unsafe fn from_u8(p: u8) -> Self;
    unsafe fn into_u8(self) -> u8;
}
Expand description

A peer obtained either from Peers (get_peers) or from get_me.

Required Methods§

Source

unsafe fn from_u8(p: u8) -> Self

Restore the peer from a primitive type (u8).

§Safety

See AnyPeer::into_u8.

Source

unsafe fn into_u8(self) -> u8

Dump the peer as a primitive type (u8).

§Safety

For most applications, Peers, Peer, and Me types should be considered opaque and agnostic of their internal representation. However, some code interpreters written for Firefly in Rust (firefly-lua) might need the ability to save values on the virtual stack as primitive types, and this is where this function comes in handy.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§