pub struct RecordHeaders { /* private fields */ }Expand description
A mutable ordered collection of RecordHeader objects.
Note that multiple headers may have the same key. The order of headers is preserved in the order they were added.
Once set_read_only() is called, all
mutating operations will return an error.
Implementations§
Source§impl RecordHeaders
impl RecordHeaders
Sourcepub fn with_header_slice(headers: &[RecordHeader]) -> Self
pub fn with_header_slice(headers: &[RecordHeader]) -> Self
Create RecordHeaders holding a copy of the given headers, in order.
§Arguments
headers- the headers to copy
Sourcepub fn with_header_iter(headers: impl IntoIterator<Item = RecordHeader>) -> Self
pub fn with_header_iter(headers: impl IntoIterator<Item = RecordHeader>) -> Self
Sourcepub fn with_record_headers(other: &RecordHeaders) -> Self
pub fn with_record_headers(other: &RecordHeaders) -> Self
Create RecordHeaders by copying from another RecordHeaders, as Java’s
RecordHeaders(Iterable<Header>) does given a RecordHeaders.
The new instance is writable regardless of the source’s read-only state. It shares the source’s list until either of them is written.
§Arguments
other- the headers to copy
Sourcepub fn set_read_only(&mut self)
pub fn set_read_only(&mut self)
Set the headers to read-only mode.
After calling this, all mutating operations will return an error.
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Returns whether the headers are in read-only mode.
Trait Implementations§
Source§impl Clone for RecordHeaders
impl Clone for RecordHeaders
Source§fn clone(&self) -> RecordHeaders
fn clone(&self) -> RecordHeaders
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 RecordHeaders
impl Debug for RecordHeaders
Source§impl Default for RecordHeaders
impl Default for RecordHeaders
Source§impl Display for RecordHeaders
impl Display for RecordHeaders
Source§impl FromIterator<RecordHeader> for RecordHeaders
impl FromIterator<RecordHeader> for RecordHeaders
Source§fn from_iter<I: IntoIterator<Item = RecordHeader>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = RecordHeader>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl Hash for RecordHeaders
impl Hash for RecordHeaders
Source§impl Headers for RecordHeaders
impl Headers for RecordHeaders
Source§fn add_with_header(
&mut self,
header: RecordHeader,
) -> Result<(), LocalIllegalStateError>
fn add_with_header( &mut self, header: RecordHeader, ) -> Result<(), LocalIllegalStateError>
Adds a header (key inside), to the end, returning if the operation succeeded. Read more
Source§fn add_with_key_value(
&mut self,
key: &str,
value: Option<&[u8]>,
) -> Result<(), LocalIllegalStateError>
fn add_with_key_value( &mut self, key: &str, value: Option<&[u8]>, ) -> Result<(), LocalIllegalStateError>
Creates and adds a header, to the end, returning if the operation succeeded. Read more
Source§fn remove(&mut self, key: &str) -> Result<(), LocalIllegalStateError>
fn remove(&mut self, key: &str) -> Result<(), LocalIllegalStateError>
Removes all headers for the given key returning if the operation succeeded,
while preserving the insertion order of the remaining headers. Read more
Source§fn last_header(&self, key: &str) -> Option<&RecordHeader>
fn last_header(&self, key: &str) -> Option<&RecordHeader>
Returns just one (the very last) header for the given key, if present. Read more
Source§fn headers(&self, key: &str) -> Vec<&RecordHeader>
fn headers(&self, key: &str) -> Vec<&RecordHeader>
Returns all headers for the given key, in the order they were added in, if present. Read more
Source§fn to_array(&self) -> &[RecordHeader]
fn to_array(&self) -> &[RecordHeader]
Returns all headers as a slice, in the order they were added in. Read more
Source§fn iter(&self) -> Iter<'_, RecordHeader>
fn iter(&self) -> Iter<'_, RecordHeader>
Returns an iterator over the headers.
Source§impl<'a> IntoIterator for &'a RecordHeaders
impl<'a> IntoIterator for &'a RecordHeaders
Source§impl PartialEq for RecordHeaders
impl PartialEq for RecordHeaders
impl Eq for RecordHeaders
Auto Trait Implementations§
impl Freeze for RecordHeaders
impl RefUnwindSafe for RecordHeaders
impl Send for RecordHeaders
impl Sync for RecordHeaders
impl Unpin for RecordHeaders
impl UnsafeUnpin for RecordHeaders
impl UnwindSafe for RecordHeaders
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more