Struct LiveStateResolver

Source
pub struct LiveStateResolver {
    pub touchdown_locations: Vec<TouchdownLocation>,
    pub organic_locations: Vec<OrganicLocation>,
    pub status: Option<Status>,
    pub modules_info: Option<ModulesInfo>,
    pub cargo: Option<Cargo>,
    pub nav_route: Option<NavRoute>,
    pub outfitting: Option<Outfitting>,
    pub shipyard: Option<Shipyard>,
    pub market: Option<Market>,
    pub backpack: Option<Backpack>,
    pub ship_locker: Option<ShipLocker>,
    pub last_ship_status: Option<ShipStatus>,
}
Expand description

Life state tracks state from the logs and combines them with state from live files like for example the status.json file to provide more context in some instances. Something that is special about this state it that is cannot be constructed from just the log files, so this is the only state that can de Serialized and importantly Deserialized. This way state can be saved to disk and retrieved at a later time when you want to continue with the same state.

Fields§

§touchdown_locations: Vec<TouchdownLocation>

The locations where the player has landed on planets.

§organic_locations: Vec<OrganicLocation>

The locations of scanned organics on different planets.

§status: Option<Status>§modules_info: Option<ModulesInfo>§cargo: Option<Cargo>§nav_route: Option<NavRoute>§outfitting: Option<Outfitting>§shipyard: Option<Shipyard>§market: Option<Market>§backpack: Option<Backpack>§ship_locker: Option<ShipLocker>§last_ship_status: Option<ShipStatus>

This field keeps track of the last known ship status. This can be used to access information about the player’s ship when the player is on-foot.

Implementations§

Source§

impl LiveStateResolver

Source

pub fn valid_status(&self, timestamp: &DateTime<Utc>) -> Option<&Status>

Returns the valid available status based on the given timestamp.

Source

pub fn valid_module_info( &self, timestamp: &DateTime<Utc>, ) -> Option<&ModulesInfo>

Returns the valid available module info based on the given timestamp.

Source

pub fn valid_cargo(&self, timestamp: &DateTime<Utc>) -> Option<&Cargo>

Returns the valid available cargo based on the given timestamp.

Source

pub fn valid_nav_route(&self, timestamp: &DateTime<Utc>) -> Option<&NavRoute>

Returns the valid available nav route based on the given timestamp.

Source

pub fn valid_outfitting(&self, timestamp: &DateTime<Utc>) -> Option<&Outfitting>

Returns the valid available outfitting based on the given timestamp.

Source

pub fn valid_shipyard(&self, timestamp: &DateTime<Utc>) -> Option<&Shipyard>

Returns the valid available shipyard based on the given timestamp.

Source

pub fn valid_market(&self, timestamp: &DateTime<Utc>) -> Option<&Market>

Returns the valid available market based on the given timestamp.

Source

pub fn valid_backpack(&self, timestamp: &DateTime<Utc>) -> Option<&Backpack>

Returns the valid available market based on the given timestamp.

Source

pub fn valid_ship_locker( &self, timestamp: &DateTime<Utc>, ) -> Option<&ShipLocker>

Returns the valid available ship locker based on the given timestamp.

Source

pub fn current_ship_status(&self) -> Option<&ShipStatus>

Returns the current available status about the player’s ship.

Source

pub fn valid_ship_status( &self, timestamp: &DateTime<Utc>, ) -> Option<&ShipStatus>

Returns the valid ship status based on the given timestamp.

Source

pub fn current_planet_status(&self) -> Option<&PlanetStatus>

Returns the current status information about the planet the player is currently close to.

Source

pub fn valid_planet_status( &self, timestamp: &DateTime<Utc>, ) -> Option<&PlanetStatus>

Returns the valid planet status based on the given timestamp.

Trait Implementations§

Source§

impl Default for LiveStateResolver

Source§

fn default() -> LiveStateResolver

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

impl<'de> Deserialize<'de> for LiveStateResolver

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 Serialize for LiveStateResolver

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

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> 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, 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>,