Skip to main content

Settings

Struct Settings 

Source
pub struct Settings {
Show 20 fields pub xp: u32, pub badges: u32, pub lang: [u8; 2], pub country: [u8; 2], pub name: String, pub timezone: String, pub rotate_screen: bool, pub screen_brightness: u8, pub leds_brightness: u8, pub speakers_volume: u8, pub headphones_volume: u8, pub font_size: u8, pub theme: u32, pub auto_lock: u8, pub reduce_flashing: bool, pub telemetry: bool, pub gamepad_mode: bool, pub contrast: bool, pub easter_eggs: bool, pub extra_flags: u32,
}
Expand description

System settings. Stored in sys/config.

Since we don’t have a realiable vesioning for the system config, some of the settings are added “just in case” and might be not used yet or maybe even won’t be ever used.

Fields§

§xp: u32

How much XP the player earned over all games.

§badges: u32

How many badges the player earned over all games.

§lang: [u8; 2]

A two-letter ASCII ISO 639 Set 1 language code.

§country: [u8; 2]

A two-letter ASCII uppercase ISO 3166-1 alpha-2 country code.

§name: String

The device name. Randomly generated when creating vFS.

§timezone: String

The full timezone name as in the IANA database.

§rotate_screen: bool

If true, rotate the image on the screen 180 degrees.

§screen_brightness: u8

Brightness of the screen backlight.

§leds_brightness: u8

Brightness of the LEDs.

§speakers_volume: u8

How loud the speakers should play sounds.

§headphones_volume: u8

How loud the headphones should play sounds.

§font_size: u8

The preferred font size (text character height) in pixels.

§theme: u32

Color scheme to use.

§auto_lock: u8

Automatically lock the screen after N minutes.

If zero, never locks automatically. The screen is never locked when in multiplayer.

§reduce_flashing: bool

If enabled, apps are advised to skip flashy animations.

§telemetry: bool

If enabled, collect and send anonymous telemetry.

§gamepad_mode: bool

Emulate gamepad when connecting Firefly Zero to a PC via USB.

§contrast: bool

Increase contrast of colors in the default color palette.

§easter_eggs: bool

Let the system apps show easter eggs, holiday effects, and weird jokes.

§extra_flags: u32

Any feature new fields will be encoded in this field, for backward compatibility.

Trait Implementations§

Source§

impl Clone for Settings

Source§

fn clone(&self) -> Settings

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Settings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Settings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Settings

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Encode<'_> for Settings

Source§

fn decode(s: &'a [u8]) -> Result<Self, Error>

Load object from bytes generated by [Encode::encode]. Read more
Source§

fn encode_vec(&self) -> Result<Vec<u8>, Error>

Encode the object as a Vec. Read more
Source§

fn encode_buf<'b>(&self, buf: &'b mut [u8]) -> Result<&'b mut [u8], Error>

Encode the object using the buffer. Read more
Source§

fn size(&self) -> usize

Calculate the buffer size required to encode the object.
Source§

impl PartialEq for Settings

Source§

fn eq(&self, other: &Settings) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Settings

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Settings

Source§

impl StructuralPartialEq for Settings

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,