pub struct Field {Show 13 fields
pub path: String,
pub name: String,
pub level: u8,
pub kind: FieldKind,
pub offset: u32,
pub len: u32,
pub redefines_of: Option<String>,
pub occurs: Option<Occurs>,
pub sync_padding: Option<u16>,
pub synchronized: bool,
pub blank_when_zero: bool,
pub resolved_renames: Option<ResolvedRenames>,
pub children: Vec<Field>,
}Expand description
A field in the copybook schema
Fields§
§path: StringHierarchical path (e.g., “ROOT.CUSTOMER.ID”)
name: StringField name (last component of path)
level: u8Level number from copybook
kind: FieldKindField type and characteristics
offset: u32Byte offset within record
len: u32Field length in bytes
redefines_of: Option<String>Path of field this redefines (if any)
occurs: Option<Occurs>Array information (if any)
sync_padding: Option<u16>Alignment padding bytes (if SYNCHRONIZED)
synchronized: boolWhether field is SYNCHRONIZED
blank_when_zero: boolWhether field has BLANK WHEN ZERO
resolved_renames: Option<ResolvedRenames>Resolved RENAMES information (for level-66 fields only)
children: Vec<Field>Child fields (for groups)
Implementations§
Source§impl Field
impl Field
Sourcepub fn with_kind(level: u8, name: String, kind: FieldKind) -> Self
pub fn with_kind(level: u8, name: String, kind: FieldKind) -> Self
Create a new field with all parameters
Sourcepub fn effective_length(&self) -> u32
pub fn effective_length(&self) -> u32
Get the effective length including any arrays
Sourcepub fn sign_separate(&self) -> Option<&SignSeparateInfo>
pub fn sign_separate(&self) -> Option<&SignSeparateInfo>
Returns SIGN SEPARATE info if this is a zoned decimal field with that clause.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Field
impl<'de> Deserialize<'de> for Field
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnsafeUnpin for Field
impl UnwindSafe for Field
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