Skip to main content

CfiCache

Struct CfiCache 

Source
pub struct CfiCache<'a> { /* private fields */ }
Expand description

A cache file for call frame information (CFI).

The default way to use this cache is to construct it from an Object and save it to a file. Then, load it from the file and pass it to the minidump processor.

use std::fs::File;
use symbolic_common::ByteView;
use symbolic_debuginfo::Object;
use symbolic_cfi::CfiCache;

let view = ByteView::open("/path/to/object")?;
let object = Object::parse(&view)?;
let cache = CfiCache::from_object(&object)?;
cache.write_to(File::create("my.cficache")?)?;
use symbolic_common::ByteView;
use symbolic_cfi::CfiCache;

let view = ByteView::open("my.cficache")?;
let cache = CfiCache::from_bytes(view)?;

Implementations§

Source§

impl CfiCache<'static>

Source

pub fn from_object(object: &Object<'_>) -> Result<Self, CfiError>

Construct a CFI cache from an Object.

Source§

impl<'a> CfiCache<'a>

Source

pub fn from_bytes(byteview: ByteView<'a>) -> Result<Self, CfiError>

Load a symcache from a ByteView.

Source

pub fn version(&self) -> u32

Returns the cache file format version.

Source

pub fn is_latest(&self) -> bool

Returns whether this cache is up-to-date.

Source

pub fn as_slice(&self) -> &[u8]

Returns the raw buffer of the cache file.

Source

pub fn write_to<W: Write>(&self, writer: W) -> Result<(), Error>

Writes the cache to the given writer.

Auto Trait Implementations§

§

impl<'a> Freeze for CfiCache<'a>

§

impl<'a> RefUnwindSafe for CfiCache<'a>

§

impl<'a> Send for CfiCache<'a>

§

impl<'a> Sync for CfiCache<'a>

§

impl<'a> Unpin for CfiCache<'a>

§

impl<'a> UnwindSafe for CfiCache<'a>

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<I, T> ExtractContext<I, ()> for T

Source§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. 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<I> RecreateContext<I> for I

Source§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. 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.