pub struct TargetRuleBuilder { /* private fields */ }Expand description
Builder for creating target-specific transformation rules.
Implementations§
Source§impl TargetRuleBuilder
impl TargetRuleBuilder
Sourcepub fn rename_field(self, from: &'static str, to: &'static str) -> Self
pub fn rename_field(self, from: &'static str, to: &'static str) -> Self
Rename a field.
Sourcepub fn hide_field(self, field: &'static str) -> Self
pub fn hide_field(self, field: &'static str) -> Self
Hide a field from display.
Sourcepub fn truncate_field(self, field: &'static str, max_len: usize) -> Self
pub fn truncate_field(self, field: &'static str, max_len: usize) -> Self
Truncate a field to the specified length.
Sourcepub fn prefix_field(self, field: &'static str, prefix: &'static str) -> Self
pub fn prefix_field(self, field: &'static str, prefix: &'static str) -> Self
Add a static prefix to a field.
Sourcepub fn transform_field(
self,
field: &'static str,
transform: fn(&str) -> String,
) -> Self
pub fn transform_field( self, field: &'static str, transform: fn(&str) -> String, ) -> Self
Apply a custom transformation to a field.
Sourcepub fn build(self) -> TargetRule
pub fn build(self) -> TargetRule
Build the target rule (internal method).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TargetRuleBuilder
impl RefUnwindSafe for TargetRuleBuilder
impl Send for TargetRuleBuilder
impl Sync for TargetRuleBuilder
impl Unpin for TargetRuleBuilder
impl UnwindSafe for TargetRuleBuilder
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