pub struct FieldGenBuilder { /* private fields */ }Expand description
Builder for NamedFieldGF: provides a friendly, chainable API to assemble field generators.
Implementations§
Source§impl FieldGenBuilder
impl FieldGenBuilder
Sourcepub fn insert_conf(self, name: impl Into<FNameStr>, conf: FieldGenConf) -> Self
pub fn insert_conf(self, name: impl Into<FNameStr>, conf: FieldGenConf) -> Self
Insert a raw config for name.
Sourcepub fn digit(self, name: impl Into<FNameStr>, beg: i64, end: i64) -> Self
pub fn digit(self, name: impl Into<FNameStr>, beg: i64, end: i64) -> Self
Add a digit field in range [beg, end).
Sourcepub fn float(self, name: impl Into<FNameStr>, beg: f64, end: f64) -> Self
pub fn float(self, name: impl Into<FNameStr>, beg: f64, end: f64) -> Self
Add a float field in range [beg, end).
Sourcepub fn ip(self, name: impl Into<FNameStr>, beg: Ipv4Addr, end: Ipv4Addr) -> Self
pub fn ip(self, name: impl Into<FNameStr>, beg: Ipv4Addr, end: Ipv4Addr) -> Self
Add an IPv4 field with [beg, end) range.
Sourcepub fn chars(self, name: impl Into<FNameStr>) -> Self
pub fn chars(self, name: impl Into<FNameStr>) -> Self
Add a chars field with no predefined scope (free text generator).
Sourcepub fn chars_from(self, name: impl Into<FNameStr>, values: &[&str]) -> Self
pub fn chars_from(self, name: impl Into<FNameStr>, values: &[&str]) -> Self
Add a chars field that randomly picks from the provided set.
Sourcepub fn with_fmt(self, name: &str, fmt: impl Into<String>) -> Self
pub fn with_fmt(self, name: &str, fmt: impl Into<String>) -> Self
Attach a format string for an existing field (no-op if the field does not exist).
Sourcepub fn build(self) -> NamedFieldGF
pub fn build(self) -> NamedFieldGF
Finalize and get the underlying map.
Trait Implementations§
Source§impl Clone for FieldGenBuilder
impl Clone for FieldGenBuilder
Source§fn clone(&self) -> FieldGenBuilder
fn clone(&self) -> FieldGenBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FieldGenBuilder
impl Debug for FieldGenBuilder
Source§impl Default for FieldGenBuilder
impl Default for FieldGenBuilder
Source§fn default() -> FieldGenBuilder
fn default() -> FieldGenBuilder
Returns the “default value” for a type. Read more
Source§impl From<FieldGenBuilder> for NamedFieldGF
impl From<FieldGenBuilder> for NamedFieldGF
Source§fn from(b: FieldGenBuilder) -> Self
fn from(b: FieldGenBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for FieldGenBuilder
impl RefUnwindSafe for FieldGenBuilder
impl Send for FieldGenBuilder
impl Sync for FieldGenBuilder
impl Unpin for FieldGenBuilder
impl UnsafeUnpin for FieldGenBuilder
impl UnwindSafe for FieldGenBuilder
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