pub struct ResponseHeaders<'storage> { /* private fields */ }Expand description
Caller-storage-backed fixed-capacity response-header metadata.
Ordinary equality is intentionally unavailable because retained values may be sensitive.
ⓘ
use cloud_sdk::transport::ResponseHeaders;
let mut storage = [0_u8; 4096];
let headers = ResponseHeaders::new(&mut storage);
let _ = headers == headers;Implementations§
Source§impl<'storage> ResponseHeaders<'storage>
impl<'storage> ResponseHeaders<'storage>
Sourcepub fn try_push(
&mut self,
name: &str,
value: &[u8],
sensitivity: HeaderSensitivity,
) -> Result<(), HeaderError>
pub fn try_push( &mut self, name: &str, value: &[u8], sensitivity: HeaderSensitivity, ) -> Result<(), HeaderError>
Appends one header atomically after validating every bound.
Sourcepub const fn encoded_len(&self) -> usize
pub const fn encoded_len(&self) -> usize
Returns the aggregate encoded field-line length.
Sourcepub fn iter(&self) -> impl Iterator<Item = ResponseHeader<'_>>
pub fn iter(&self) -> impl Iterator<Item = ResponseHeader<'_>>
Iterates in retained order.
Sourcepub fn get(&self, name: &str) -> Option<ResponseHeader<'_>>
pub fn get(&self, name: &str) -> Option<ResponseHeader<'_>>
Finds a retained header by ASCII case-insensitive name.
Sourcepub fn retain_copy_into<'destination>(
&self,
destination: &'destination mut [u8],
) -> Result<ResponseHeaders<'destination>, HeaderError>
pub fn retain_copy_into<'destination>( &self, destination: &'destination mut [u8], ) -> Result<ResponseHeaders<'destination>, HeaderError>
Creates a deliberate second cleanup-owning copy in caller storage.
Both the source and returned collection independently clear their complete caller-owned storage on drop.
Trait Implementations§
Source§impl Debug for ResponseHeaders<'_>
impl Debug for ResponseHeaders<'_>
Source§impl Drop for ResponseHeaders<'_>
impl Drop for ResponseHeaders<'_>
Auto Trait Implementations§
impl<'storage> !UnwindSafe for ResponseHeaders<'storage>
impl<'storage> Freeze for ResponseHeaders<'storage>
impl<'storage> RefUnwindSafe for ResponseHeaders<'storage>
impl<'storage> Send for ResponseHeaders<'storage>
impl<'storage> Sync for ResponseHeaders<'storage>
impl<'storage> Unpin for ResponseHeaders<'storage>
impl<'storage> UnsafeUnpin for ResponseHeaders<'storage>
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