sark-http 0.39.0

HTTP wire types, semantics, codecs, and ownership invariants for Sark
Documentation
//! Linear response ownership handoff.

use o3::buffer::hold;

use crate::payload::owned;

pub mod copy;
mod origin;
mod plan;
mod slot;
pub mod stage;

#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Error {
    Retain(owned::Error),
    Overflow(hold::Overflow),
}

/// Wire length and resident ownership of a completed response body.
#[derive(Clone, Copy, Default, PartialEq, Eq)]
pub struct Owner {
    pub len: usize,
    pub charge: hold::Charge,
}

impl Owner {
    pub fn inline(len: usize) -> Self {
        Self {
            len,
            charge: hold::Charge::default(),
        }
    }
}

use origin::Origin;
pub use plan::Selection;
pub use slot::Slot;

const _: () = assert!(size_of::<Error>() <= 4 * size_of::<usize>());