pub struct GeneratorArgs {
pub down: Option<bool>,
pub middle: Option<bool>,
pub size: Option<ZalgoSize>,
pub up: Option<bool>,
}
Expand description
Arguments to provide to Generator::gen
and Generator::simple_gen
.
§Examples
Instantiating args directly:
use zalgo::{GeneratorArgs, ZalgoSize};
GeneratorArgs {
down: Some(true),
size: Some(ZalgoSize::Mini),
..Default::default()
};
Creating args via GeneratorArgs::new
:
use zalgo::{GeneratorArgs, ZalgoSize};
GeneratorArgs::new(false, false, true, ZalgoSize::Maxi);
Fields§
§down: Option<bool>
Whether to produce zalgo below the text.
middle: Option<bool>
Whether to produce zalgo in the middle of the text.
size: Option<ZalgoSize>
The amount of zalgo to produce.
up: Option<bool>
Whether to produce zalgo above the text.
Implementations§
Source§impl GeneratorArgs
impl GeneratorArgs
Sourcepub fn new(up: bool, middle: bool, down: bool, size: ZalgoSize) -> Self
pub fn new(up: bool, middle: bool, down: bool, size: ZalgoSize) -> Self
Creates new generator arguments.
Examples found in repository?
examples/gen.rs (line 11)
6fn main() {
7 let mut generator = Generator::new();
8
9 // Create Zalgo text with Zalgo `char`s in all positions, with a maximum
10 // amount of Zalgo:
11 generator.gen("test", &mut String::new(), &GeneratorArgs::new(true, true, true, ZalgoSize::Maxi));
12
13 // Create Zalgo text with Zalgo `char`s in only the middle and lower
14 // positions, with a minimum amount of Zalgo:
15 generator.gen("test", &mut String::new(), &GeneratorArgs::new(false, true, true, ZalgoSize::Mini));
16
17 // Create Zalgo text with Zalgo `char`s in only the lower position, with a
18 // random amount of Zalgo (can be a low amount or high amount):
19 generator.gen("test", &mut String::new(), &GeneratorArgs::new(false, false, true, ZalgoSize::None));
20
21 // Consequentially, you can also not modify your given text with any Zalgo:
22 // Technically the `ZalgoSize` value given does not matter here.
23 generator.gen("test", &mut String::new(), &GeneratorArgs::new(false, false, false, ZalgoSize::None));
24}
Trait Implementations§
Source§impl Clone for GeneratorArgs
impl Clone for GeneratorArgs
Source§fn clone(&self) -> GeneratorArgs
fn clone(&self) -> GeneratorArgs
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 GeneratorArgs
impl Debug for GeneratorArgs
Source§impl Default for GeneratorArgs
impl Default for GeneratorArgs
Source§fn default() -> GeneratorArgs
fn default() -> GeneratorArgs
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GeneratorArgs
impl RefUnwindSafe for GeneratorArgs
impl Send for GeneratorArgs
impl Sync for GeneratorArgs
impl Unpin for GeneratorArgs
impl UnwindSafe for GeneratorArgs
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