pub struct ChioLayer { /* private fields */ }Expand description
Tower Layer that wraps inner services with Chio evaluation.
§Example
use chio_tower::ChioLayer;
use chio_core_types::crypto::Keypair;
let keypair = Keypair::generate();
let layer = ChioLayer::new(keypair, "policy-hash".to_string());Implementations§
Source§impl ChioLayer
impl ChioLayer
Sourcepub fn new(keypair: Keypair, policy_hash: String) -> Self
pub fn new(keypair: Keypair, policy_hash: String) -> Self
Create a fail-closed Chio layer with the given kernel keypair and policy
hash. No durable store is attached; use ChioLayer::builder to wire
one, or ChioLayer::new_ephemeral for an in-memory scaffold.
Sourcepub fn new_ephemeral(keypair: Keypair, policy_hash: String) -> Self
pub fn new_ephemeral(keypair: Keypair, policy_hash: String) -> Self
Create an explicitly ephemeral Chio layer for local scaffolds and tests.
Sourcepub fn builder(keypair: Keypair, policy_hash: String) -> ChioLayerBuilder
pub fn builder(keypair: Keypair, policy_hash: String) -> ChioLayerBuilder
Start building a layer backed by durable receipt and revocation stores.
Sourcepub fn from_evaluator(evaluator: ChioEvaluator) -> Self
pub fn from_evaluator(evaluator: ChioEvaluator) -> Self
Create a layer from an existing evaluator.
Sourcepub fn with_max_body_bytes(self, max_body_bytes: usize) -> Self
pub fn with_max_body_bytes(self, max_body_bytes: usize) -> Self
Override the maximum body size buffered for hashing in each request.
See ChioService::with_max_body_bytes for details.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ChioLayer
impl !UnwindSafe for ChioLayer
impl Freeze for ChioLayer
impl Send for ChioLayer
impl Sync for ChioLayer
impl Unpin for ChioLayer
impl UnsafeUnpin for ChioLayer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more