pub struct FileMetadata { /* private fields */ }Implementations§
Source§impl FileMetadata
impl FileMetadata
pub fn new() -> Ref<Self>
pub fn with_filename(name: &str) -> Ref<Self>
pub fn close(&self)
pub fn session_id(&self) -> usize
pub fn filename(&self) -> String
pub fn set_filename(&self, name: &str)
pub fn modified(&self) -> bool
pub fn mark_modified(&self)
pub fn mark_saved(&self)
pub fn is_analysis_changed(&self) -> bool
pub fn is_database_backed(&self) -> bool
pub fn is_database_backed_for_view_type(&self, view_type: &str) -> bool
Sourcepub fn run_undoable_transaction<F: FnOnce() -> Result<T, E>, T, E>(
&self,
func: F,
) -> Result<T, E>
pub fn run_undoable_transaction<F: FnOnce() -> Result<T, E>, T, E>( &self, func: F, ) -> Result<T, E>
Runs a failable function where the failure state will revert any undo actions that occurred during the time of the function’s execution.
NOTE: This will commit or undo any actions that occurred on any thread as this state is not thread local.
NOTE: This is NOT thread safe, if you are holding any locks that might be held by both the main thread and the thread executing this function, you can deadlock. You should also never call this function on multiple threads at a time. See the following issues:
Sourcepub fn begin_undo_actions(&self, anonymous_allowed: bool) -> String
pub fn begin_undo_actions(&self, anonymous_allowed: bool) -> String
Creates a new undo entry, any undo actions after this will be added to this entry.
NOTE: This is NOT thread safe, if you are holding any locks that might be held by both the main thread and the thread executing this function, you can deadlock. You should also never call this function on multiple threads at a time. See the following issues:
Sourcepub fn commit_undo_actions(&self, id: &str)
pub fn commit_undo_actions(&self, id: &str)
Commits the undo entry with the id to the undo buffer.
NOTE: This is NOT thread safe, if you are holding any locks that might be held by both the main thread and the thread executing this function, you can deadlock. You should also never call this function on multiple threads at a time. See the following issues:
Sourcepub fn revert_undo_actions(&self, id: &str)
pub fn revert_undo_actions(&self, id: &str)
Reverts the undo actions committed in the undo entry.
NOTE: This is NOT thread safe, if you are holding any locks that might be held by both the main thread and the thread executing this function, you can deadlock. You should also never call this function on multiple threads at a time. See the following issues:
Sourcepub fn forget_undo_actions(&self, id: &str)
pub fn forget_undo_actions(&self, id: &str)
Forgets the undo actions committed in the undo entry.
NOTE: This is NOT thread safe, if you are holding any locks that might be held by both the main thread and the thread executing this function, you can deadlock. You should also never call this function on multiple threads at a time. See the following issues:
pub fn undo(&self)
pub fn redo(&self)
pub fn current_view(&self) -> String
pub fn current_offset(&self) -> u64
Navigate to an offset for a specific view.
§Example
use binaryninja::file_metadata::FileMetadata;
file.navigate_to("Linear:Raw", 0x0).expect("Linear:Raw should always be present");Sourcepub fn view_of_type(&self, view: &str) -> Option<Ref<BinaryView>>
pub fn view_of_type(&self, view: &str) -> Option<Ref<BinaryView>>
Get the BinaryView for the view type.
§Example
use binaryninja::file_metadata::FileMetadata;
file.view_of_type("Raw").expect("Raw type should always be present");pub fn view_types(&self) -> Array<BnString>
Sourcepub fn project_file(&self) -> Option<Ref<ProjectFile>>
pub fn project_file(&self) -> Option<Ref<ProjectFile>>
Get the ProjectFile for the FileMetadata.
pub fn create_database(&self, file_path: impl AsRef<Path>) -> bool
pub fn create_database_with_progress<P: ProgressCallback>( &self, file_path: impl AsRef<Path>, progress: P, ) -> bool
pub fn save_auto_snapshot(&self) -> bool
pub fn open_database_for_configuration( &self, file: &Path, ) -> Result<Ref<BinaryView>, ()>
pub fn open_database(&self, file: &Path) -> Result<Ref<BinaryView>, ()>
pub fn open_database_with_progress<P: ProgressCallback>( &self, file: &Path, progress: P, ) -> Result<Ref<BinaryView>, ()>
Trait Implementations§
Source§impl Debug for FileMetadata
impl Debug for FileMetadata
Source§impl Hash for FileMetadata
impl Hash for FileMetadata
Source§impl PartialEq for FileMetadata
impl PartialEq for FileMetadata
Source§impl ToOwned for FileMetadata
impl ToOwned for FileMetadata
Source§type Owned = Ref<FileMetadata>
type Owned = Ref<FileMetadata>
Source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
impl Eq for FileMetadata
impl Send for FileMetadata
impl StructuralPartialEq for FileMetadata
impl Sync for FileMetadata
Auto Trait Implementations§
impl Freeze for FileMetadata
impl RefUnwindSafe for FileMetadata
impl Unpin for FileMetadata
impl UnwindSafe for FileMetadata
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more