pub struct GateProtocol;Implementations§
Source§impl GateProtocol
impl GateProtocol
Sourcepub fn parse(stdin: &str) -> Result<GateInput, GateError>
pub fn parse(stdin: &str) -> Result<GateInput, GateError>
Parse the JSON payload Claude Code writes to the hook’s stdin.
Sourcepub fn read_schema_from_env() -> Result<u32, GateError>
pub fn read_schema_from_env() -> Result<u32, GateError>
Read KLASP_GATE_SCHEMA from the environment and parse it as a u32.
Returns GateError::SchemaMissing when the variable is not set, and
GateError::Parse when the value cannot be parsed as an integer.
Designed to be composed with check_schema_env.
Sourcepub fn check_schema_env(env_value: u32) -> Result<(), GateError>
pub fn check_schema_env(env_value: u32) -> Result<(), GateError>
Compare the env-var schema (set by the shim) with the binary’s
compiled-in schema. The shim’s value is read from the environment
by the caller and passed in here as a u32 — this function never
touches the environment itself, keeping it pure and testable.
Auto Trait Implementations§
impl Freeze for GateProtocol
impl RefUnwindSafe for GateProtocol
impl Send for GateProtocol
impl Sync for GateProtocol
impl Unpin for GateProtocol
impl UnsafeUnpin for GateProtocol
impl UnwindSafe for GateProtocol
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