Trait screenruster_saver::Saver [] [src]

pub trait Saver {
    fn begin(&mut self);
    fn end(&mut self);
    fn state(&self) -> State;
    fn render<S: Surface>(&self, target: &mut S, screen: &Texture2d);

    fn config(&mut self, config: JsonValue) { ... }
    fn initialize(&mut self, context: Rc<Context>) { ... }
    fn resize(&mut self, context: Rc<Context>) { ... }
    fn throttle(&mut self, value: bool) { ... }
    fn blank(&mut self, value: bool) { ... }
    fn pointer(&mut self, value: Pointer) { ... }
    fn password(&mut self, value: Password) { ... }
    fn update(&mut self) { ... }
}

Required Methods

fn begin(&mut self)

The saver has been started, useful to implement a fade in or animation to only show at the beginning.

fn end(&mut self)

The saver has been stopped, useful to implement a fade out or animation to show at the end.

fn state(&self) -> State

Return the current saver state.

fn render<S: Surface>(&self, target: &mut S, screen: &Texture2d)

Render the saver.

Provided Methods

fn config(&mut self, config: JsonValue)

Initialize configuration.

fn initialize(&mut self, context: Rc<Context>)

Initialize any graphics related stuff.

fn resize(&mut self, context: Rc<Context>)

Resize the viewport.

fn throttle(&mut self, value: bool)

Whether to try and reduce power usage or not.

fn blank(&mut self, value: bool)

Whether the screen has been blanked or unblanked.

fn pointer(&mut self, value: Pointer)

The pointer moved or clicked.

fn password(&mut self, value: Password)

The password is being interacted with.

fn update(&mut self)

Called every 15 milliseconds.

Implementors