pub struct ProtocolValidator { /* private fields */ }Expand description
Protocol validator that validates manifests against JSON Schema
Implementations§
Source§impl ProtocolValidator
impl ProtocolValidator
Sourcepub fn new() -> Result<Self, ProtocolError>
pub fn new() -> Result<Self, ProtocolError>
Create a new validator with the v1 schema.
Schema loading strategy (in order):
- GitHub URL (canonical source) - priority, used in production and CI
- AI_PROTOCOL_DIR as GitHub URL (if set and is a URL)
- Local file system (for offline development) - fallback if GitHub unavailable
This ensures all validation uses the same standard schema, while allowing local development when network is unavailable.
Sourcepub fn validate(&self, manifest: &ProtocolManifest) -> Result<(), ProtocolError>
pub fn validate(&self, manifest: &ProtocolManifest) -> Result<(), ProtocolError>
Validate a protocol manifest using the compiled JSON Schema
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProtocolValidator
impl !RefUnwindSafe for ProtocolValidator
impl Send for ProtocolValidator
impl Sync for ProtocolValidator
impl Unpin for ProtocolValidator
impl !UnwindSafe for ProtocolValidator
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