Skip to main content

Session

Struct Session 

Source
pub struct Session { /* private fields */ }

Implementations§

Source§

impl Session

Source

pub fn game(&self) -> Game

Source

pub fn snapshot(&self) -> &Snapshot

Source

pub fn capabilities(&self) -> &Capabilities

Source

pub fn export_character(&self) -> CharacterExport

Source

pub fn apply_character( &mut self, character: &CharacterExport, ) -> Result<(), CoreError>

Source

pub fn special_stats(&self) -> Vec<StatEntry>

Source

pub fn derived_stats_nonzero(&self) -> Vec<StatEntry>

Source

pub fn skills(&self) -> Vec<SkillEntry>

Source

pub fn tagged_skill_indices(&self) -> Vec<usize>

Source

pub fn active_perks(&self) -> Vec<PerkEntry>

Source

pub fn selected_traits(&self) -> Vec<TraitEntry>

Source

pub fn all_kill_counts(&self) -> Vec<KillCountEntry>

Source

pub fn nonzero_kill_counts(&self) -> Vec<KillCountEntry>

Source

pub fn map_files(&self) -> Vec<String>

Source

pub fn age(&self) -> i32

Source

pub fn max_hp(&self) -> i32

Source

pub fn next_level_xp(&self) -> i32

Source

pub fn stat(&self, index: usize) -> StatEntry

Source

pub fn stats(&self) -> Vec<StatEntry>

Source

pub fn all_derived_stats(&self) -> Vec<StatEntry>

Source

pub fn inventory(&self) -> Vec<InventoryEntry>

Source

pub fn inventory_resolved( &self, catalog: &ItemCatalog, ) -> Vec<ResolvedInventoryEntry>

Source

pub fn inventory_resolved_builtin(&self) -> Vec<ResolvedInventoryEntry>

Resolve inventory using the built-in well-known item table. Falls back to pid-only entries for items not in the table.

Source

pub fn inventory_total_weight_lbs(&self, catalog: &ItemCatalog) -> Option<i32>

Source

pub fn to_bytes_unmodified(&self) -> Result<Vec<u8>, CoreError>

Source

pub fn to_bytes_modified(&self) -> Result<Vec<u8>, CoreError>

Source

pub fn current_hp(&self) -> Option<i32>

Source

pub fn set_hp(&mut self, hp: i32) -> Result<(), CoreError>

Source

pub fn set_base_stat( &mut self, stat_index: usize, value: i32, ) -> Result<(), CoreError>

Source

pub fn set_gender(&mut self, gender: Gender) -> Result<(), CoreError>

Source

pub fn set_age(&mut self, age: i32) -> Result<(), CoreError>

Source

pub fn set_level(&mut self, level: i32) -> Result<(), CoreError>

Source

pub fn set_experience(&mut self, experience: i32) -> Result<(), CoreError>

Source

pub fn set_skill_points(&mut self, skill_points: i32) -> Result<(), CoreError>

Source

pub fn set_reputation(&mut self, reputation: i32) -> Result<(), CoreError>

Source

pub fn set_karma(&mut self, karma: i32) -> Result<(), CoreError>

Source

pub fn set_trait( &mut self, slot: usize, trait_index: usize, ) -> Result<(), CoreError>

Source

pub fn clear_trait(&mut self, slot: usize) -> Result<(), CoreError>

Source

pub fn set_perk_rank( &mut self, perk_index: usize, rank: i32, ) -> Result<(), CoreError>

Source

pub fn clear_perk(&mut self, perk_index: usize) -> Result<(), CoreError>

Source

pub fn set_inventory_quantity( &mut self, pid: i32, quantity: i32, ) -> Result<(), CoreError>

Source

pub fn add_inventory_item( &mut self, pid: i32, quantity: i32, ) -> Result<(), CoreError>

Source

pub fn remove_inventory_item( &mut self, pid: i32, quantity: Option<i32>, ) -> Result<(), CoreError>

Trait Implementations§

Source§

impl Debug for Session

Source§

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

Formats the value using the given formatter. 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.