pub struct ZapSchema { /* private fields */ }Expand description
ZAP schema compiler
Supports both .zap (whitespace-significant) and .capnp (Cap’n Proto
compatible) syntaxes. The .zap format is the recommended default for
all new schema definitions.
Implementations§
Source§impl ZapSchema
impl ZapSchema
Sourcepub fn new(source: &str, path: &str) -> Self
pub fn new(source: &str, path: &str) -> Self
Create a new ZAP schema from source (defaults to .zap format)
Sourcepub fn with_format(source: &str, path: &str, format: SchemaFormat) -> Self
pub fn with_format(source: &str, path: &str, format: SchemaFormat) -> Self
Create a schema with explicit format
Sourcepub fn from_file(path: &Path) -> Result<Self>
pub fn from_file(path: &Path) -> Result<Self>
Load a ZAP schema from file (auto-detects format from extension)
Sourcepub fn format(&self) -> &SchemaFormat
pub fn format(&self) -> &SchemaFormat
Get the detected schema format
Sourcepub fn compile(&self) -> Result<String>
pub fn compile(&self) -> Result<String>
Compile to ZAP wire format schema (internal representation)
Sourcepub fn to_capnp(&self) -> Result<String>
👎Deprecated: use compile() instead
pub fn to_capnp(&self) -> Result<String>
Compile to the legacy format (for compatibility)
Auto Trait Implementations§
impl Freeze for ZapSchema
impl RefUnwindSafe for ZapSchema
impl Send for ZapSchema
impl Sync for ZapSchema
impl Unpin for ZapSchema
impl UnwindSafe for ZapSchema
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