pub struct MarshalFile { /* private fields */ }
Expand description
High-level parser for pyc
and “marshal dump” files
Implementations§
Source§impl MarshalFile
impl MarshalFile
Sourcepub fn from_pyc_path<S>(path: S) -> Result<Self, Error>
pub fn from_pyc_path<S>(path: S) -> Result<Self, Error>
Read and parse a pyc
file at the specified path
Sourcepub fn from_dump_path<S>(
path: S,
(major, minor): (u16, u16),
) -> Result<Self, Error>
pub fn from_dump_path<S>( path: S, (major, minor): (u16, u16), ) -> Result<Self, Error>
Read and parse a “marshal dump” file at the specified path
Sourcepub fn into_inner(self) -> Object
pub fn into_inner(self) -> Object
Consume this MarshalFile
to obtain the inner Object
Sourcepub fn print_unused_ref_flags(&self)
pub fn print_unused_ref_flags(&self)
Print objects with unused reference flags to stdout
Sourcepub fn write_normalized<S>(self, path: S) -> Result<bool, Error>
pub fn write_normalized<S>(self, path: S) -> Result<bool, Error>
Rewrite file to remove unused reference flags
This can be useful to generate pyc
files that are reproducible across
different CPU architectures.
If no unused reference flags are found, no file is written, and false
is returned. If a file is written, true
is returned.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MarshalFile
impl RefUnwindSafe for MarshalFile
impl Send for MarshalFile
impl Sync for MarshalFile
impl Unpin for MarshalFile
impl UnwindSafe for MarshalFile
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