pub struct ResponseMetadata {
pub status: Status,
pub version: Option<Version>,
pub fields: Fields,
pub content_length: Option<u64>,
pub persistent: Option<bool>,
pub protocol: Option<Protocol>,
}Expand description
Informational and final responses share the same metadata. Protocol/responder capabilities sequence heads; upgrades and CONNECT use bidirectional bodies, with resource lifecycle retained by the exchange/driver.
Fields§
§status: Status§version: Option<Version>§fields: Fields§content_length: Option<u64>Declared representation length, independent of whether this message has readable data (for example HEAD and 304 responses).
persistent: Option<bool>Outgoing connection reuse preference. Received hop-specific decisions are retained by the protocol exchange, rather than forwarded as fields.
protocol: Option<Protocol>Implementations§
Source§impl ResponseMetadata
impl ResponseMetadata
pub fn new(status: Status) -> Self
Sourcepub fn declared_length(&self, body: Option<u64>) -> Option<u64>
pub fn declared_length(&self, body: Option<u64>) -> Option<u64>
The declared content_length, unless a body of the given known length contradicts it, as after replacing the body. A codec sending this response’s data uses it; a response without data, to HEAD or with 204 or 304, is described by content_length itself, so every protocol resolves the same length.