[−][src]Struct hpack_codec::field::LiteralHeaderField
Literal representation of a header field.
Methods
impl<'a> LiteralHeaderField<'a>
[src]
pub fn new(name: &'a [u8], value: &'a [u8]) -> Self
[src]
Makes a new LiteralHeaderField
instance.
Examples
use hpack_codec::field::{LiteralHeaderField, LiteralFieldForm};; let field = LiteralHeaderField::new(b"foo", b"bar"); assert_eq!(field.form(), LiteralFieldForm::WithoutIndexing);
pub fn with_indexed_name<N>(name: N, value: &'a [u8]) -> Self where
N: Into<Index>,
[src]
N: Into<Index>,
Makes a new LiteralHeaderField
instance with the specified indexed name.
Examples
use hpack_codec::field::{LiteralHeaderField, LiteralFieldForm};; use hpack_codec::table::{Index, StaticEntry}; // Uses an index of the static table. let field = LiteralHeaderField::with_indexed_name(StaticEntry::Method, b"foo"); // Uses an index of a dynamic table; let field = LiteralHeaderField::with_indexed_name(Index::dynamic_table_offset() + 2, b"bar");
pub fn with_indexing(self) -> Self
[src]
Specifies to index this header field into a dynamic table.
pub fn never_indexed(self) -> Self
[src]
Specifies that this header field will be never indexed into a dynamic table.
pub fn with_huffman_encoded_name(self) -> Self
[src]
Encodes the name of this header field by huffman coding.
pub fn with_huffman_encoded_value(self) -> Self
[src]
Encodes the value of this header field by huffman coding.
pub fn name(&self) -> &FieldName
[src]
Returns the name of this header field.
pub fn value(&self) -> &HpackString
[src]
Returns the value of this header field.
pub fn form(&self) -> LiteralFieldForm
[src]
Returns the form of this header field.
Trait Implementations
impl<'a> From<LiteralHeaderField<'a>> for RawHeaderField<'a>
[src]
fn from(f: LiteralHeaderField<'a>) -> Self
[src]
impl<'a> Debug for LiteralHeaderField<'a>
[src]
Auto Trait Implementations
impl<'a> Send for LiteralHeaderField<'a>
impl<'a> Sync for LiteralHeaderField<'a>
impl<'a> Unpin for LiteralHeaderField<'a>
impl<'a> UnwindSafe for LiteralHeaderField<'a>
impl<'a> RefUnwindSafe for LiteralHeaderField<'a>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,