Struct kerbalobjects::ko::symbols::KOSymbol
source · pub struct KOSymbol {
pub name_idx: StringIdx,
pub value_idx: DataIdx,
pub size: u16,
pub sym_bind: SymBind,
pub sym_type: SymType,
pub sh_idx: SectionIdx,
}
Expand description
Represents a symbol in a symbol table in a Kerbal Object file
Fields§
§name_idx: StringIdx
The index into the .symstrtab that is the name of this symbol
value_idx: DataIdx
The index into the .data section that this symbol refers to
size: u16
The size of the data this symbol refers to in bytes
sym_bind: SymBind
The symbol binding of this symbol
sym_type: SymType
The symbol type
sh_idx: SectionIdx
The section header index this symbol refers to
Implementations§
source§impl KOSymbol
impl KOSymbol
sourcepub const fn new(
name_idx: StringIdx,
value_idx: DataIdx,
size: u16,
sym_bind: SymBind,
sym_type: SymType,
sh_idx: SectionIdx
) -> Self
pub const fn new( name_idx: StringIdx, value_idx: DataIdx, size: u16, sym_bind: SymBind, sym_type: SymType, sh_idx: SectionIdx ) -> Self
Creates a new KOSymbol
sourcepub const fn size_bytes() -> u32
pub const fn size_bytes() -> u32
Returns the size of a symbol table entry in bytes
sourcepub fn parse(source: &mut BufferIterator<'_>) -> Result<Self, SymbolParseError>
pub fn parse(source: &mut BufferIterator<'_>) -> Result<Self, SymbolParseError>
Parses a KOSymbol from the provided buffer
sourcepub fn write(&self, buf: &mut impl WritableBuffer)
pub fn write(&self, buf: &mut impl WritableBuffer)
Converts this KOSymbol to its binary representation and appends it to the provided buffer
Trait Implementations§
source§impl PartialEq<KOSymbol> for KOSymbol
impl PartialEq<KOSymbol> for KOSymbol
impl Copy for KOSymbol
impl Eq for KOSymbol
impl StructuralEq for KOSymbol
impl StructuralPartialEq for KOSymbol
Auto Trait Implementations§
impl RefUnwindSafe for KOSymbol
impl Send for KOSymbol
impl Sync for KOSymbol
impl Unpin for KOSymbol
impl UnwindSafe for KOSymbol
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