sark-http 0.22.0

HTTP wire types, semantics, codecs, and ownership invariants for Sark
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::num::NonZero;

use crate::request::span::Span;

pub(in crate::h1::head::request) struct Line {
    pub(super) start: NonZero<u32>,
    pub(super) end: u32,
}

impl Line {
    pub(in crate::h1::head::request) fn from_span(span: Span) -> Self {
        Self {
            start: unsafe { NonZero::new_unchecked(span.start() as u32 + 1) },
            end: span.end() as u32,
        }
    }
}