Skip to main content

HeaderFieldSource

Trait HeaderFieldSource 

Source
pub trait HeaderFieldSource: FieldSourceSealed {
    // Required methods
    fn visit_fields_while<'a>(
        &'a self,
        visitor: &mut dyn FnMut(&'a str, &'a str) -> bool,
    );
    fn to_header_map(&self) -> HeaderMap;
}
Expand description

A validated, borrowed view of remoting command extension fields.

This trait is sealed because source implementations must guarantee that every visited key and value is valid immutable UTF-8 for the full source borrow. Returning false from the visitor stops the scan early.

Required Methods§

Source

fn visit_fields_while<'a>( &'a self, visitor: &mut dyn FnMut(&'a str, &'a str) -> bool, )

Visits fields without allocating owned key/value strings.

Source

fn to_header_map(&self) -> HeaderMap

Produces the owned compatibility representation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§