pub struct LoopNameGenerator { /* private fields */ }Expand description
Generator for human-readable loop names.
Implementations§
Source§impl LoopNameGenerator
impl LoopNameGenerator
Sourcepub fn new(config: LoopNamingConfig) -> Self
pub fn new(config: LoopNamingConfig) -> Self
Create a new generator with the given configuration.
Sourcepub fn from_config(config: &LoopNamingConfig) -> Self
pub fn from_config(config: &LoopNamingConfig) -> Self
Create a generator from config, using defaults if not configured.
Sourcepub fn generate(&self, prompt: &str) -> String
pub fn generate(&self, prompt: &str) -> String
Generate a name from a prompt.
Returns a name in the format: keywords-adjective-noun
For example: fix-header-swift-peacock
Sourcepub fn generate_unique(
&self,
prompt: &str,
exists: impl Fn(&str) -> bool,
) -> String
pub fn generate_unique( &self, prompt: &str, exists: impl Fn(&str) -> bool, ) -> String
Generate a unique name, using exists to check for collisions.
Tries up to 3 times with different suffixes before falling back to timestamp format.
Sourcepub fn generate_memorable(&self) -> String
pub fn generate_memorable(&self) -> String
Generate a memorable name (adjective-noun only, no keywords).
Returns a name like “bright-maple” or “swift-falcon”.
Auto Trait Implementations§
impl Freeze for LoopNameGenerator
impl RefUnwindSafe for LoopNameGenerator
impl Send for LoopNameGenerator
impl Sync for LoopNameGenerator
impl Unpin for LoopNameGenerator
impl UnwindSafe for LoopNameGenerator
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