pub struct Context {Show 20 fields
pub fb: Box<dyn Framebuffer>,
pub alarm_manager: Option<AlarmManager>,
pub display: Display,
pub settings: Settings,
pub library: Library,
pub database: Database,
pub fonts: Fonts,
pub dictionaries: BTreeMap<String, Dictionary>,
pub keyboard_layouts: BTreeMap<String, Layout>,
pub input_history: FxHashMap<ViewId, VecDeque<String>>,
pub frontlight: Box<dyn Frontlight>,
pub battery: Box<dyn Battery>,
pub lightsensor: Box<dyn LightSensor>,
pub notification_index: u8,
pub kb_rect: Rectangle,
pub rng: Xoroshiro128Plus,
pub plugged: bool,
pub covered: bool,
pub shared: bool,
pub online: bool,
}Fields§
§fb: Box<dyn Framebuffer>§alarm_manager: Option<AlarmManager>§display: Display§settings: Settings§library: Library§database: Database§fonts: Fonts§dictionaries: BTreeMap<String, Dictionary>§keyboard_layouts: BTreeMap<String, Layout>§input_history: FxHashMap<ViewId, VecDeque<String>>§frontlight: Box<dyn Frontlight>§battery: Box<dyn Battery>§lightsensor: Box<dyn LightSensor>§notification_index: u8§kb_rect: Rectangle§rng: Xoroshiro128Plus§plugged: bool§covered: bool§online: boolImplementations§
Source§impl Context
impl Context
pub fn new( fb: Box<dyn Framebuffer>, rtc: Option<Rtc>, library: Library, database: Database, settings: Settings, fonts: Fonts, battery: Box<dyn Battery>, frontlight: Box<dyn Frontlight>, lightsensor: Box<dyn LightSensor>, ) -> Context
pub fn load_keyboard_layouts(&mut self)
pub fn load_dictionaries(&mut self)
pub fn record_input(&mut self, text: &str, id: ViewId)
pub fn set_frontlight(&mut self, enable: bool)
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl !UnwindSafe for Context
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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