pub struct Infinite { /* private fields */ }Expand description
Struct for storing state
Implementations§
Source§impl Infinite
impl Infinite
Sourcepub fn set_msg(&mut self, msg: &str)
pub fn set_msg(&mut self, msg: &str)
Examples found in repository?
examples/basic.rs (line 7)
4pub fn main() -> Result<()> {
5 println!("\n100 ms delay");
6 let mut loader = Infinite::new().to_stderr();
7 loader.set_msg("Polling");
8
9 let start_thread = loader.start()?;
10 let now = Instant::now();
11 thread::sleep(Duration::from_secs(2));
12 loader.stop()?;
13 println!("elapsed {} {:?}",start_thread, now.elapsed());
14
15 Ok(())
16}More examples
examples/with_done.rs (line 7)
4pub fn main() -> Result<()> {
5 println!("\n100 ms delay");
6 let mut loader = Infinite::new().to_stderr();
7 loader.set_msg("Polling");
8 loader.set_done(true);
9
10 let start_thread = loader.start()?;
11 let now = Instant::now();
12 thread::sleep(Duration::from_secs(2));
13 loader.stop()?;
14 println!("elapsed {} {:?}",start_thread, now.elapsed());
15
16 Ok(())
17}examples/change_speed.rs (line 7)
4pub fn main() -> Result<()> {
5 println!("\n100 ms delay");
6 let mut loader = Infinite::new().to_stderr();
7 loader.set_msg("Polling");
8
9 let start_thread = loader.start()?;
10 let now = Instant::now();
11 thread::sleep(Duration::from_secs(2));
12 loader.stop()?;
13 println!("elapsed {} {:?}",start_thread, now.elapsed());
14
15 println!("10 ms delay");
16 loader.set_delay(Duration::from_millis(1));
17 loader.start()?;
18 let now = Instant::now();
19 thread::sleep(Duration::from_secs(2));
20 loader.stop()?;
21 println!("elapsed {:?}", now.elapsed());
22
23 Ok(())
24}Sourcepub fn set_delay(&mut self, d: Duration)
pub fn set_delay(&mut self, d: Duration)
Examples found in repository?
examples/change_speed.rs (line 16)
4pub fn main() -> Result<()> {
5 println!("\n100 ms delay");
6 let mut loader = Infinite::new().to_stderr();
7 loader.set_msg("Polling");
8
9 let start_thread = loader.start()?;
10 let now = Instant::now();
11 thread::sleep(Duration::from_secs(2));
12 loader.stop()?;
13 println!("elapsed {} {:?}",start_thread, now.elapsed());
14
15 println!("10 ms delay");
16 loader.set_delay(Duration::from_millis(1));
17 loader.start()?;
18 let now = Instant::now();
19 thread::sleep(Duration::from_secs(2));
20 loader.stop()?;
21 println!("elapsed {:?}", now.elapsed());
22
23 Ok(())
24}Sourcepub fn set_done(&mut self, done: bool)
pub fn set_done(&mut self, done: bool)
Examples found in repository?
examples/with_done.rs (line 8)
4pub fn main() -> Result<()> {
5 println!("\n100 ms delay");
6 let mut loader = Infinite::new().to_stderr();
7 loader.set_msg("Polling");
8 loader.set_done(true);
9
10 let start_thread = loader.start()?;
11 let now = Instant::now();
12 thread::sleep(Duration::from_secs(2));
13 loader.stop()?;
14 println!("elapsed {} {:?}",start_thread, now.elapsed());
15
16 Ok(())
17}pub fn get_msg(&self) -> &str
pub fn get_delay(&self) -> Duration
Sourcepub fn stop(&mut self) -> Result<()>
pub fn stop(&mut self) -> Result<()>
Examples found in repository?
examples/basic.rs (line 12)
4pub fn main() -> Result<()> {
5 println!("\n100 ms delay");
6 let mut loader = Infinite::new().to_stderr();
7 loader.set_msg("Polling");
8
9 let start_thread = loader.start()?;
10 let now = Instant::now();
11 thread::sleep(Duration::from_secs(2));
12 loader.stop()?;
13 println!("elapsed {} {:?}",start_thread, now.elapsed());
14
15 Ok(())
16}More examples
examples/with_done.rs (line 13)
4pub fn main() -> Result<()> {
5 println!("\n100 ms delay");
6 let mut loader = Infinite::new().to_stderr();
7 loader.set_msg("Polling");
8 loader.set_done(true);
9
10 let start_thread = loader.start()?;
11 let now = Instant::now();
12 thread::sleep(Duration::from_secs(2));
13 loader.stop()?;
14 println!("elapsed {} {:?}",start_thread, now.elapsed());
15
16 Ok(())
17}examples/change_speed.rs (line 12)
4pub fn main() -> Result<()> {
5 println!("\n100 ms delay");
6 let mut loader = Infinite::new().to_stderr();
7 loader.set_msg("Polling");
8
9 let start_thread = loader.start()?;
10 let now = Instant::now();
11 thread::sleep(Duration::from_secs(2));
12 loader.stop()?;
13 println!("elapsed {} {:?}",start_thread, now.elapsed());
14
15 println!("10 ms delay");
16 loader.set_delay(Duration::from_millis(1));
17 loader.start()?;
18 let now = Instant::now();
19 thread::sleep(Duration::from_secs(2));
20 loader.stop()?;
21 println!("elapsed {:?}", now.elapsed());
22
23 Ok(())
24}Sourcepub fn start<'a>(&'a mut self) -> Result<String>
pub fn start<'a>(&'a mut self) -> Result<String>
Examples found in repository?
examples/basic.rs (line 9)
4pub fn main() -> Result<()> {
5 println!("\n100 ms delay");
6 let mut loader = Infinite::new().to_stderr();
7 loader.set_msg("Polling");
8
9 let start_thread = loader.start()?;
10 let now = Instant::now();
11 thread::sleep(Duration::from_secs(2));
12 loader.stop()?;
13 println!("elapsed {} {:?}",start_thread, now.elapsed());
14
15 Ok(())
16}More examples
examples/with_done.rs (line 10)
4pub fn main() -> Result<()> {
5 println!("\n100 ms delay");
6 let mut loader = Infinite::new().to_stderr();
7 loader.set_msg("Polling");
8 loader.set_done(true);
9
10 let start_thread = loader.start()?;
11 let now = Instant::now();
12 thread::sleep(Duration::from_secs(2));
13 loader.stop()?;
14 println!("elapsed {} {:?}",start_thread, now.elapsed());
15
16 Ok(())
17}examples/change_speed.rs (line 9)
4pub fn main() -> Result<()> {
5 println!("\n100 ms delay");
6 let mut loader = Infinite::new().to_stderr();
7 loader.set_msg("Polling");
8
9 let start_thread = loader.start()?;
10 let now = Instant::now();
11 thread::sleep(Duration::from_secs(2));
12 loader.stop()?;
13 println!("elapsed {} {:?}",start_thread, now.elapsed());
14
15 println!("10 ms delay");
16 loader.set_delay(Duration::from_millis(1));
17 loader.start()?;
18 let now = Instant::now();
19 thread::sleep(Duration::from_secs(2));
20 loader.stop()?;
21 println!("elapsed {:?}", now.elapsed());
22
23 Ok(())
24}pub fn render_end(&mut self) -> Result<()>
pub fn render(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Infinite
impl RefUnwindSafe for Infinite
impl Send for Infinite
impl Sync for Infinite
impl Unpin for Infinite
impl UnwindSafe for Infinite
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