pub struct ExternalPort {
pub node: Atom,
pub id: u64,
pub creation: u32,
pub local_ext_bytes: Option<Bytes>,
}Expand description
Represents an Erlang port originating from a remote node.
Like PIDs, ports 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§id: u64§creation: u32§local_ext_bytes: Option<Bytes>If this port was decoded from LOCAL_EXT, this contains the hash (8 bytes) and nested term bytes for transparent re-encoding.
Uses Bytes for efficient zero-copy cloning of frequently-decoded terms.
Implementations§
Source§impl ExternalPort
impl ExternalPort
pub fn new(node: Atom, id: u64, creation: u32) -> Self
Sourcepub fn with_local_ext_bytes(
node: Atom,
id: u64,
creation: u32,
local_ext_bytes: impl Into<Bytes>,
) -> Self
pub fn with_local_ext_bytes( node: Atom, id: u64, creation: u32, local_ext_bytes: impl Into<Bytes>, ) -> Self
Creates a new port 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 port was decoded from LOCAL_EXT encoding.
Trait Implementations§
Source§impl Clone for ExternalPort
impl Clone for ExternalPort
Source§fn clone(&self) -> ExternalPort
fn clone(&self) -> ExternalPort
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 ExternalPort
impl Debug for ExternalPort
Source§impl Hash for ExternalPort
impl Hash for ExternalPort
Source§impl Ord for ExternalPort
impl Ord for ExternalPort
Source§impl PartialEq for ExternalPort
impl PartialEq for ExternalPort
Source§impl PartialOrd for ExternalPort
impl PartialOrd for ExternalPort
impl Eq for ExternalPort
Auto Trait Implementations§
impl !Freeze for ExternalPort
impl RefUnwindSafe for ExternalPort
impl Send for ExternalPort
impl Sync for ExternalPort
impl Unpin for ExternalPort
impl UnwindSafe for ExternalPort
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