pub struct ExternalReference {
pub node: Atom,
pub creation: u32,
pub ids: Vec<u32>,
pub local_ext_bytes: Option<Bytes>,
}Expand description
Represents an Erlang reference originating from a remote node.
Like PIDs, references can be encoded via LOCAL_EXT. The local_ext_bytes field
preserves the original encoding for transparent re-encoding.
Note: The local_ext_bytes field is excluded from equality, hash, and ordering
comparisons.
Fields§
§node: Atom§creation: u32§ids: Vec<u32>§local_ext_bytes: Option<Bytes>If this reference was decoded from LOCAL_EXT, this contains the hash (8 bytes) and nested term bytes for transparent re-encoding.
Bytes offer zero-copy cloning.
Implementations§
Source§impl ExternalReference
impl ExternalReference
pub fn new(node: Atom, creation: u32, ids: Vec<u32>) -> Self
Sourcepub fn with_local_ext_bytes(
node: Atom,
creation: u32,
ids: Vec<u32>,
local_ext_bytes: impl Into<Bytes>,
) -> Self
pub fn with_local_ext_bytes( node: Atom, creation: u32, ids: Vec<u32>, local_ext_bytes: impl Into<Bytes>, ) -> Self
Creates a new reference with preserved LOCAL_EXT bytes.
Accepts any type that can be converted to Bytes (e.g., Vec<u8>, &[u8], Bytes).
Sourcepub fn is_local_ext(&self) -> bool
pub fn is_local_ext(&self) -> bool
Returns true if this reference was decoded from LOCAL_EXT encoding.
Trait Implementations§
Source§impl Clone for ExternalReference
impl Clone for ExternalReference
Source§fn clone(&self) -> ExternalReference
fn clone(&self) -> ExternalReference
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExternalReference
impl Debug for ExternalReference
Source§impl Hash for ExternalReference
impl Hash for ExternalReference
Source§impl Ord for ExternalReference
impl Ord for ExternalReference
Source§impl PartialEq for ExternalReference
impl PartialEq for ExternalReference
Source§impl PartialOrd for ExternalReference
impl PartialOrd for ExternalReference
impl Eq for ExternalReference
Auto Trait Implementations§
impl !Freeze for ExternalReference
impl RefUnwindSafe for ExternalReference
impl Send for ExternalReference
impl Sync for ExternalReference
impl Unpin for ExternalReference
impl UnwindSafe for ExternalReference
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more