pub struct Screensaver {
pub open: bool,
pub opened_at: Instant,
pub weather: Option<WeatherInfo>,
pub cryptex_input: bool,
pub cryptex_buf: String,
pub god_mode: bool,
/* private fields */
}Fields§
§open: bool§opened_at: Instant§weather: Option<WeatherInfo>§cryptex_input: bool/ opens cryptex password entry (easter egg).
cryptex_buf: StringTyped password (not shown as plain in status — only on cryptex).
god_mode: boolEaster egg: all splash text becomes “god” until screensaver reopens.
Implementations§
Source§impl Screensaver
impl Screensaver
pub fn new() -> Self
pub fn open(&mut self)
pub fn close(&mut self)
pub fn toggle(&mut self)
Sourcepub fn begin_cryptex_input(&mut self)
pub fn begin_cryptex_input(&mut self)
Start / cryptex input mode.
pub fn cancel_cryptex_input(&mut self)
Sourcepub fn cryptex_push(&mut self, c: char)
pub fn cryptex_push(&mut self, c: char)
Push a character into the cryptex (max 16).
pub fn cryptex_backspace(&mut self)
Sourcepub fn submit_cryptex(&mut self) -> bool
pub fn submit_cryptex(&mut self) -> bool
Submit password. Returns true if the easter egg unlocked.
Trait Implementations§
Source§impl Debug for Screensaver
impl Debug for Screensaver
Auto Trait Implementations§
impl !Sync for Screensaver
impl Freeze for Screensaver
impl RefUnwindSafe for Screensaver
impl Send for Screensaver
impl Unpin for Screensaver
impl UnsafeUnpin for Screensaver
impl UnwindSafe for Screensaver
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more