pub struct CpBuilder { /* private fields */ }Expand description
Builder for the CP=&&...&& section.
This helper focuses on string assembly (HJ212 is ASCII). It intentionally does not prescribe numeric formatting; callers pass values as strings.
Implementations§
Source§impl CpBuilder
impl CpBuilder
pub fn new() -> Self
Sourcepub fn data_time(&mut self, data_time: impl AsRef<str>) -> &mut Self
pub fn data_time(&mut self, data_time: impl AsRef<str>) -> &mut Self
Set DataTime=YYYYMMDDhhmmss.
Sourcepub fn kv(&mut self, key: impl AsRef<str>, value: impl AsRef<str>) -> &mut Self
pub fn kv(&mut self, key: impl AsRef<str>, value: impl AsRef<str>) -> &mut Self
Append a raw key=value field.
Sourcepub fn rtd_flag(
&mut self,
code: impl AsRef<str>,
rtd_value: impl AsRef<str>,
flag: impl AsRef<str>,
) -> &mut Self
pub fn rtd_flag( &mut self, code: impl AsRef<str>, rtd_value: impl AsRef<str>, flag: impl AsRef<str>, ) -> &mut Self
Append a pair of *-Rtd and *-Flag fields in the common format used by platforms.
Example output fragment:
a21026-Rtd=12.3,a21026-Flag=N
Note: the default CP parser only splits fields on ;. The comma here is intentionally
left for the business layer to interpret if needed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CpBuilder
impl RefUnwindSafe for CpBuilder
impl Send for CpBuilder
impl Sync for CpBuilder
impl Unpin for CpBuilder
impl UnwindSafe for CpBuilder
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