[][src]Struct kerbalobjects::Symbol

pub struct Symbol { /* fields omitted */ }

Represents a single symbol in an object file. This can be a function, an object, program data, or anything else.

Implementations

impl Symbol[src]

pub fn new(
    name: &str,
    value: KOSValue,
    size: u16,
    info: SymbolInfo,
    symbol_type: SymbolType,
    section_index: usize
) -> Symbol
[src]

Creates a new symbol from parts

pub fn read(
    symstrtab: &StringTable,
    symdata: &SymbolDataSection,
    reader: &mut KOFileReader
) -> Result<Symbol, Box<dyn Error>>
[src]

Reads a symbol from the symbol table of a KO file

pub fn write(&self, writer: &mut KOFileWriter) -> Result<(), Box<dyn Error>>[src]

Write this symbol to a KOFileWriter

pub fn size(&self) -> u16[src]

Returns the size of the data this symbol represents as stored in the KO file

pub fn width(&self) -> u32[src]

Returns the width of one symbol in a symbol table

pub fn name(&self) -> &String[src]

Returns the stored name of this symbol

pub fn value(&self) -> &KOSValue[src]

Returns the kOS value that this symbol is associated with

pub fn get_type(&self) -> SymbolType[src]

Returns this symbol's type

pub fn get_info(&self) -> SymbolInfo[src]

Returns the visibility info of this symbol

pub fn set_name_index(&mut self, index: usize)[src]

Sets the symbol's name's index into the Symbol String Table

pub fn set_value_index(&mut self, index: usize)[src]

Sets the symbol's value's index into the Symbol Data Table

pub fn get_value_index(&self) -> usize[src]

Returns the symbol's value index

pub fn get_section_index(&self) -> usize[src]

Returns the index of the section that this symbol refers to

pub fn to_string(&self) -> String[src]

Returns a string representation of this symbol that is mostly only useful for hashing

Trait Implementations

impl Clone for Symbol[src]

impl Debug for Symbol[src]

impl Hash for Symbol[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.