pub struct Copybook {
pub record_name: String,
pub encoding: String,
pub fields: Vec<FieldDecl>,
}Expand description
A copybook: the record name, the declared character encoding (informational, carried into the packet), and the top-level fields in order.
Fields§
§record_name: StringThe 01-level record name.
encoding: StringThe declared character encoding, e.g. ascii or ebcdic-cp-us. Carried into the packet as
encoding; kobold-json decodes display bytes as-is and does not transcode.
fields: Vec<FieldDecl>The top-level fields, in record order.
Implementations§
Source§impl Copybook
impl Copybook
Sourcepub fn record_length(&self) -> usize
pub fn record_length(&self) -> usize
The total declared record length = sum of top-level field lengths.
Sourcepub fn canonical_bytes(&self) -> Vec<u8> ⓘ
pub fn canonical_bytes(&self) -> Vec<u8> ⓘ
A stable, canonical byte serialization of the copybook layout, used as the input to
copybook_hash. Deterministic: a pure function of the structure (names/pics/offsets/lengths/kinds),
independent of insertion-time state.
Trait Implementations§
impl Eq for Copybook
impl StructuralPartialEq for Copybook
Auto Trait Implementations§
impl Freeze for Copybook
impl RefUnwindSafe for Copybook
impl Send for Copybook
impl Sync for Copybook
impl Unpin for Copybook
impl UnsafeUnpin for Copybook
impl UnwindSafe for Copybook
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