pub struct Lease {
pub time_to_live: u32,
pub number_of_requests: u32,
pub metadata: BytesMut,
/* private fields */
}Expand description
LEASE Frame (0x02)
Lease frames MAY be sent by the client-side or server-side Responders and inform the Requester that it may send Requests for a period of time and how many it may send during that duration. See Lease Semantics for more information.
The last received LEASE frame overrides all previous LEASE frame values.
Lease frames MUST always use Stream ID 0 as they pertain to the Connection.
§Frame Contents
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream ID = 0 |
+-----------+-+-+---------------+-------------------------------+
|Frame Type |0|M| Flags |
+-----------+-+-+---------------+-------------------------------+
|0| Time-To-Live |
+---------------------------------------------------------------+
|0| Number of Requests |
+---------------------------------------------------------------+
Metadata§Notes
-
A Responder implementation MAY stop all further requests by sending a
Leasewith a value of0for Number of Requests or Time-To-Live. -
When a
Leaseexpires due to time, the value of the Number of Requests that a Requester may make is implicitly0. -
This frame only supports Metadata, so the Metadata Length header MUST NOT be included, even if the
FrameFlags::METADATAflag is set true.
Fields§
§time_to_live: u32Time-To-Live (TTL)
Unsigned 31-bit integer of Time (in milliseconds) for validity of
Lease from time of reception. Value MUST be > 0.
number_of_requests: u32Number of Requests
Unsigned 31-bit integer of Number of Requests that may be sent
until next Lease. Value MUST be > 0.
metadata: BytesMutLease metadata
Implementations§
Source§impl Lease
impl Lease
Sourcepub fn set_metadata(&mut self, metadata: BytesMut)
pub fn set_metadata(&mut self, metadata: BytesMut)
Sets the value of Lease.metadata
Sourcepub const fn builder() -> LeaseBuilder
pub const fn builder() -> LeaseBuilder
Creates a builder to builder a frame of this type.