pub struct BraidHeaders {
pub version: Option<Vec<Version>>,
pub parents: Option<Vec<Version>>,
pub current_version: Option<Vec<Version>>,
pub subscribe: bool,
pub peer: Option<String>,
pub heartbeat: Option<String>,
pub merge_type: Option<String>,
pub patches_count: Option<usize>,
pub content_range: Option<String>,
pub retry_after: Option<String>,
pub extra: BTreeMap<String, String>,
}Expand description
Braid-specific HTTP headers for requests and responses.
Fields§
§version: Option<Vec<Version>>Version identifier(s) from Version header
parents: Option<Vec<Version>>Parent version(s) from Parents header
current_version: Option<Vec<Version>>Current version(s) from Current-Version header
subscribe: boolSubscribe header indicating subscription mode
peer: Option<String>Peer identifier from Peer header
heartbeat: Option<String>Heartbeat interval from Heartbeats header
merge_type: Option<String>Merge type from Merge-Type header
patches_count: Option<usize>Number of patches from Patches header
content_range: Option<String>Content range from Content-Range header
retry_after: Option<String>Retry-After header for backoff guidance
extra: BTreeMap<String, String>Additional non-Braid headers
Implementations§
Source§impl BraidHeaders
impl BraidHeaders
pub fn new() -> Self
pub fn with_version(self, version: Version) -> Self
pub fn with_versions(self, versions: Vec<Version>) -> Self
pub fn with_parent(self, parent: Version) -> Self
pub fn with_parents(self, parents: Vec<Version>) -> Self
pub fn with_current_version(self, version: Version) -> Self
pub fn with_current_versions(self, versions: Vec<Version>) -> Self
pub fn with_subscribe(self) -> Self
pub fn with_merge_type(self, merge_type: impl Into<String>) -> Self
pub fn with_content_range(self, content_range: impl Into<String>) -> Self
pub fn with_heartbeat(self, interval: String) -> Self
pub fn with_peer(self, peer: String) -> Self
Sourcepub fn to_header_map(&self) -> Result<HeaderMap>
pub fn to_header_map(&self) -> Result<HeaderMap>
Convert to HTTP HeaderMap.
Sourcepub fn from_header_map(headers: &HeaderMap) -> Result<Self>
pub fn from_header_map(headers: &HeaderMap) -> Result<Self>
Parse from HTTP HeaderMap.
Trait Implementations§
Source§impl Clone for BraidHeaders
impl Clone for BraidHeaders
Source§fn clone(&self) -> BraidHeaders
fn clone(&self) -> BraidHeaders
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 BraidHeaders
impl Debug for BraidHeaders
Source§impl Default for BraidHeaders
impl Default for BraidHeaders
Source§fn default() -> BraidHeaders
fn default() -> BraidHeaders
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BraidHeaders
impl RefUnwindSafe for BraidHeaders
impl Send for BraidHeaders
impl Sync for BraidHeaders
impl Unpin for BraidHeaders
impl UnwindSafe for BraidHeaders
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