class

RNS::ResourceAdvertisement

Inherits Reference < Object

Encapsulates the metadata exchanged during resource transfer negotiation. Holds transfer size, part count, hashes, flags (encryption, compression, split, request/response), segment info, and the initial hashmap slice. Serialised to/from MessagePack for transmission inside RESOURCE_ADV packets.

Constants

COLLISION_GUARD_SIZE = (2 * Resource::WINDOW_MAX) + HASHMAP_MAX_LEN
HASHMAP_MAX_LEN = ((Link::MDU - OVERHEAD) // Resource::MAPHASH_LEN).to_i32
OVERHEAD = 134

Constructors

new(resource : Resource)
Source
new

Bare constructor for unpack

Source
unpack(data : Bytes) : ResourceAdvertisement
Source

Class methods

is_request?(advertisement_packet : Packet) : Bool
Source
is_response?(advertisement_packet : Packet) : Bool
Source
read_request_id(advertisement_packet : Packet) : Bytes | Nil
Source
read_size(advertisement_packet : Packet) : Int64
Source
read_transfer_size(advertisement_packet : Packet) : Int64
Source

Instance methods

c=(c : Bool)
Source
d=(d : Int64)
Source
e=(e : Bool)
Source
f=(f : UInt8)
Source
get_data_size
Source
get_hash
Source
get_parts
Source
get_segments
Source
get_transfer_size
Source
h=(h : Bytes)
Source
has_metadata?
Source
i=(i : Int32)
Source
is_compressed?
Source
l=(l : Int32)
Source
m=(m : Bytes)
Source
n=(n : Int32)
Source
o=(o : Bytes)
Source
p=(p : Bool)
Source
pack(segment : Int32 = 0) : Bytes
Source
q=(q : Bytes | Nil)
Source
r=(r : Bytes)
Source
s=(s : Bool)
Source
t

Fields matching Python's single-letter attributes

Source
t=(t : Int64)

Fields matching Python's single-letter attributes

Source
u=(u : Bool)
Source
x=(x : Bool)
Source