pub struct LoremRustum {
pub body: Vec<&'static str>,
pub length: usize,
}
Fields§
§body: Vec<&'static str>
§length: usize
Implementations§
Source§impl LoremRustum
impl LoremRustum
Sourcepub fn new(length: usize) -> LoremRustum
pub fn new(length: usize) -> LoremRustum
Build LoremRustum
struct with specified length
by choosing random elements from RUSTY_PHRASES
using rand::thread_rng()
.
§Examples
let lorem = lorem_rustum::LoremRustum::new(42);
println!("{}", lorem.to_string());
§Rusty Phrases:
pub static RUSTY_PHRASES: [&str; 132] = [
"rust", "borrowing", "tokio", "async", "unsafe", "thread", "trait", "&str",
"rust-analyzer", "scope", "await", "ryan", "ownership", "safety", "nightly",
"allocated", "rustlings", "stack", "heap", "no garbage collector", "runtime",
"macros", "code execution", "fmt", "clippy", "memory safe", "cargo", "built-in",
"performance", "golang sucks", "better than c++", "friendly community",
"loved by developers", "wasm", "webassembly", "actix", "axum", "rocket", "yew",
"diesel", "sqlx", "pub", "mod", "enum", "static", "missing lifetime", "rusty",
"the most admired language", "a safer alternative to C and C++", "cargo package manager",
"performance-critical services", "Ferris mascot", "fast and reliable", "control over memory allocation",
"deallocation", "deref", "derive", "impl", "implement trait for", "to_owned()",
"i'm not looking for a job", "<'static>", "mut", "&mut", "efficient and organized development workflows",
"concurrency", "multiple threads can work on shared data without introducing memory-related issues",
"low-level tools and kernels", "type checking", "unwrap", "please gouge out my eyes",
"Sync + Send", "thread safety", "spawn concurrent task", "non-blocking i/o",
"smart pointer", "<'a>", "cargo test", "async-std", "println!", "dbg!", "dyn",
"stderr", "mpsc", "async move", "Arc", "Rc", "RefCell", "Box", "||", "expect",
"map", "making", "building", "produce", "consume", "out of scope", "rustc",
"rustup", "panic", "generics", "<T>", "impl fmt::Display for", "macro",
"#[derive()]", "multiple bounds", "traits", "macro_rules!", "Some()", "Option<&T>",
"None", "RAII", "drop", "destructor", "mutability of data", "ref", "as",
"closures", "HOF", "Higher Order Functions", "lazy loading", "err", "error",
"Result<T, Error>", "()", "Err(_)", "std", "#[cfg(test)]", "assert!",
"cargo run", "publish crate", "code blocks below"
];
Trait Implementations§
Source§impl Clone for LoremRustum
impl Clone for LoremRustum
Source§fn clone(&self) -> LoremRustum
fn clone(&self) -> LoremRustum
Returns a copy 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 LoremRustum
impl Debug for LoremRustum
Source§impl Default for LoremRustum
impl Default for LoremRustum
Source§impl PartialEq for LoremRustum
impl PartialEq for LoremRustum
Source§impl ToString for LoremRustum
impl ToString for LoremRustum
impl StructuralPartialEq for LoremRustum
Auto Trait Implementations§
impl Freeze for LoremRustum
impl RefUnwindSafe for LoremRustum
impl Send for LoremRustum
impl Sync for LoremRustum
impl Unpin for LoremRustum
impl UnwindSafe for LoremRustum
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