binaryninja::collaboration

Struct RemoteProject

source
pub struct RemoteProject { /* private fields */ }

Implementations§

source§

impl RemoteProject

source

pub fn is_open(&self) -> bool

Determine if the project is open (it needs to be opened before you can access its files)

source

pub fn open(&self) -> Result<(), ()>

Open the project, allowing various file and folder based apis to work, as well as connecting a core Project

source

pub fn open_with_progress<F: ProgressCallback>( &self, progress: F, ) -> Result<(), ()>

Open the project, allowing various file and folder based apis to work, as well as connecting a core Project

source

pub fn close(&self)

Close the project and stop all background operations (e.g. file uploads)

source

pub fn get_for_local_database( database: &Database, ) -> Result<Option<Ref<Self>>, ()>

Get the Remote Project for a Database

source

pub fn get_for_binaryview(bv: &BinaryView) -> Result<Option<Ref<Self>>, ()>

Get the Remote Project for a BinaryView

source

pub fn core_project(&self) -> Result<Ref<Project>, ()>

Get the core Project for the remote project.

NOTE: If the project has not been opened, it will be opened upon calling this.

source

pub fn remote(&self) -> Result<Ref<Remote>, ()>

Get the owning remote

source

pub fn url(&self) -> BnString

Get the URL of the project

source

pub fn id(&self) -> BnString

Get the unique ID of the project

source

pub fn created(&self) -> SystemTime

Created date of the project

source

pub fn last_modified(&self) -> SystemTime

Last modification of the project

source

pub fn name(&self) -> BnString

Displayed name of file

source

pub fn set_name<S: BnStrCompatible>(&self, name: S) -> Result<(), ()>

Set the description of the file. You will need to push the file to update the remote version.

source

pub fn description(&self) -> BnString

Desciprtion of the file

source

pub fn set_description<S: BnStrCompatible>( &self, description: S, ) -> Result<(), ()>

Set the description of the file. You will need to push the file to update the remote version.

source

pub fn received_file_count(&self) -> u64

Get the number of files in a project (without needing to pull them first)

source

pub fn received_folder_count(&self) -> u64

Get the number of folders in a project (without needing to pull them first)

source

pub fn default_path(&self) -> Result<BnString, ()>

Get the default directory path for a remote Project. This is based off the Setting for collaboration.directory, the project’s id, and the project’s remote’s id.

source

pub fn has_pulled_files(&self) -> bool

If the project has pulled the folders yet

source

pub fn has_pulled_folders(&self) -> bool

If the project has pulled the folders yet

source

pub fn has_pulled_group_permissions(&self) -> bool

If the project has pulled the group permissions yet

source

pub fn has_pulled_user_permissions(&self) -> bool

If the project has pulled the user permissions yet

source

pub fn is_admin(&self) -> bool

If the currently logged in user is an administrator of the project (and can edit permissions and such for the project).

source

pub fn files(&self) -> Result<Array<RemoteFile>, ()>

Get the list of files in this project.

NOTE: If the project has not been opened, it will be opened upon calling this. NOTE: If folders have not been pulled, they will be pulled upon calling this. NOTE: If files have not been pulled, they will be pulled upon calling this.

source

pub fn get_file_by_id<S: BnStrCompatible>( &self, id: S, ) -> Result<Option<Ref<RemoteFile>>, ()>

Get a specific File in the Project by its id

NOTE: If the project has not been opened, it will be opened upon calling this. NOTE: If files have not been pulled, they will be pulled upon calling this.

source

pub fn get_file_by_name<S: BnStrCompatible>( &self, name: S, ) -> Result<Option<Ref<RemoteFile>>, ()>

Get a specific File in the Project by its name

NOTE: If the project has not been opened, it will be opened upon calling this. NOTE: If files have not been pulled, they will be pulled upon calling this.

source

pub fn pull_files(&self) -> Result<(), ()>

Pull the list of files from the Remote.

NOTE: If the project has not been opened, it will be opened upon calling this. NOTE: If folders have not been pulled, they will be pulled upon calling this.

source

pub fn pull_files_with_progress<P: ProgressCallback>( &self, progress: P, ) -> Result<(), ()>

Pull the list of files from the Remote.

NOTE: If the project has not been opened, it will be opened upon calling this. NOTE: If folders have not been pulled, they will be pulled upon calling this.

source

pub fn create_file<F, N, D>( &self, filename: F, contents: &[u8], name: N, description: D, parent_folder: Option<&RemoteFolder>, file_type: RemoteFileType, ) -> Result<Ref<RemoteFile>, ()>

Create a new file on the remote and return a reference to the created file

NOTE: If the project has not been opened, it will be opened upon calling this.

  • filename - File name
  • contents - File contents
  • name - Displayed file name
  • description - File description
  • parent_folder - Folder that will contain the file
  • file_type - Type of File to create
source

pub fn create_file_with_progress<F, N, D, P>( &self, filename: F, contents: &[u8], name: N, description: D, parent_folder: Option<&RemoteFolder>, file_type: RemoteFileType, progress: P, ) -> Result<Ref<RemoteFile>, ()>

Create a new file on the remote and return a reference to the created file

NOTE: If the project has not been opened, it will be opened upon calling this.

  • filename - File name
  • contents - File contents
  • name - Displayed file name
  • description - File description
  • parent_folder - Folder that will contain the file
  • file_type - Type of File to create
  • progress - Function to call on upload progress updates
source

pub fn push_file<I, K, V>( &self, file: &RemoteFile, extra_fields: I, ) -> Result<(), ()>

Push an updated File object to the Remote

NOTE: If the project has not been opened, it will be opened upon calling this.

source

pub fn delete_file(&self, file: &RemoteFile) -> Result<(), ()>

source

pub fn folders(&self) -> Result<Array<RemoteFolder>, ()>

Get the list of folders in this project.

NOTE: If the project has not been opened, it will be opened upon calling this. NOTE: If folders have not been pulled, they will be pulled upon calling this.

source

pub fn get_folder_by_id<S: BnStrCompatible>( &self, id: S, ) -> Result<Option<Ref<RemoteFolder>>, ()>

Get a specific Folder in the Project by its id

NOTE: If the project has not been opened, it will be opened upon calling this. NOTE: If folders have not been pulled, they will be pulled upon calling this.

source

pub fn pull_folders(&self) -> Result<(), ()>

Pull the list of folders from the Remote.

NOTE: If the project has not been opened, it will be opened upon calling this.

source

pub fn pull_folders_with_progress<P: ProgressCallback>( &self, progress: P, ) -> Result<(), ()>

Pull the list of folders from the Remote.

NOTE: If the project has not been opened, it will be opened upon calling this.

source

pub fn create_folder<N, D>( &self, name: N, description: D, parent_folder: Option<&RemoteFolder>, ) -> Result<Ref<RemoteFolder>, ()>

Create a new folder on the remote (and pull it)

NOTE: If the project has not been opened, it will be opened upon calling this.

  • name - Displayed folder name
  • description - Folder description
  • parent - Parent folder (optional)
source

pub fn create_folder_with_progress<N, D, P>( &self, name: N, description: D, parent_folder: Option<&RemoteFolder>, progress: P, ) -> Result<Ref<RemoteFolder>, ()>

Create a new folder on the remote (and pull it)

NOTE: If the project has not been opened, it will be opened upon calling this.

  • name - Displayed folder name
  • description - Folder description
  • parent - Parent folder (optional)
  • progress - Function to call on upload progress updates
source

pub fn push_folder<I, K, V>( &self, folder: &RemoteFolder, extra_fields: I, ) -> Result<(), ()>

Push an updated Folder object to the Remote

NOTE: If the project has not been opened, it will be opened upon calling this.

  • folder - Folder object which has been updated
  • extra_fields - Extra HTTP fields to send with the update
source

pub fn delete_folder(&self, folder: &RemoteFolder) -> Result<(), ()>

Delete a folder from the remote

NOTE: If the project has not been opened, it will be opened upon calling this.

source

pub fn group_permissions(&self) -> Result<Array<Permission>, ()>

Get the list of group permissions in this project.

NOTE: If group permissions have not been pulled, they will be pulled upon calling this.

source

pub fn user_permissions(&self) -> Result<Array<Permission>, ()>

Get the list of user permissions in this project.

NOTE: If user permissions have not been pulled, they will be pulled upon calling this.

source

pub fn get_permission_by_id<S: BnStrCompatible>( &self, id: S, ) -> Result<Option<Ref<Permission>>, ()>

Get a specific permission in the Project by its id.

NOTE: If group or user permissions have not been pulled, they will be pulled upon calling this.

source

pub fn pull_group_permissions(&self) -> Result<(), ()>

Pull the list of group permissions from the Remote.

source

pub fn pull_group_permissions_with_progress<F: ProgressCallback>( &self, progress: F, ) -> Result<(), ()>

Pull the list of group permissions from the Remote.

source

pub fn pull_user_permissions(&self) -> Result<(), ()>

Pull the list of user permissions from the Remote.

source

pub fn pull_user_permissions_with_progress<F: ProgressCallback>( &self, progress: F, ) -> Result<(), ()>

Pull the list of user permissions from the Remote.

source

pub fn create_group_permission( &self, group_id: i64, level: CollaborationPermissionLevel, ) -> Result<Ref<Permission>, ()>

Create a new group permission on the remote (and pull it).

§Arguments
  • group_id - Group id
  • level - Permission level
source

pub fn create_group_permission_with_progress<F: ProgressCallback>( &self, group_id: i64, level: CollaborationPermissionLevel, progress: F, ) -> Result<Ref<Permission>, ()>

Create a new group permission on the remote (and pull it).

§Arguments
  • group_id - Group id
  • level - Permission level
  • progress - Function to call for upload progress updates
source

pub fn create_user_permission<S: BnStrCompatible>( &self, user_id: S, level: CollaborationPermissionLevel, ) -> Result<Ref<Permission>, ()>

Create a new user permission on the remote (and pull it).

§Arguments
  • user_id - User id
  • level - Permission level
source

pub fn create_user_permission_with_progress<S: BnStrCompatible, F: ProgressCallback>( &self, user_id: S, level: CollaborationPermissionLevel, progress: F, ) -> Result<Ref<Permission>, ()>

Create a new user permission on the remote (and pull it).

§Arguments
  • user_id - User id
  • level - Permission level
  • progress - The progress callback to call
source

pub fn push_permission<I, K, V>( &self, permission: &Permission, extra_fields: I, ) -> Result<(), ()>

Push project permissions to the remote.

§Arguments
  • permission - Permission object which has been updated
  • extra_fields - Extra HTTP fields to send with the update
source

pub fn delete_permission(&self, permission: &Permission) -> Result<(), ()>

Delete a permission from the remote.

source

pub fn can_user_view<S: BnStrCompatible>(&self, username: S) -> bool

Determine if a user is in any of the view/edit/admin groups.

§Arguments
  • username - Username of user to check
source

pub fn can_user_edit<S: BnStrCompatible>(&self, username: S) -> bool

Determine if a user is in any of the edit/admin groups.

§Arguments
  • username - Username of user to check
source

pub fn can_user_admin<S: BnStrCompatible>(&self, username: S) -> bool

Determine if a user is in the admin group.

§Arguments
  • username - Username of user to check
source

pub fn default_project_path(&self) -> BnString

Get the default directory path for a remote Project. This is based off the Setting for collaboration.directory, the project’s id, and the project’s remote’s id.

source

pub fn upload_database<C>( &self, metadata: &FileMetadata, parent_folder: Option<&RemoteFolder>, name_changeset: C, ) -> Result<Ref<RemoteFile>, ()>
where C: NameChangeset,

Upload a file, with database, to the remote under the given project

  • metadata - Local file with database
  • parent_folder - Optional parent folder in which to place this file
  • name_changeset - Function to call for naming a pushed changeset, if necessary
source

pub fn upload_database_with_progress<C>( &self, metadata: &FileMetadata, parent_folder: Option<&RemoteFolder>, name_changeset: C, progress_function: impl ProgressCallback, ) -> Result<Ref<RemoteFile>, ()>
where C: NameChangeset,

Upload a file, with database, to the remote under the given project

  • metadata - Local file with database
  • parent_folder - Optional parent folder in which to place this file
  • progress -: Function to call for progress updates
  • name_changeset - Function to call for naming a pushed changeset, if necessary

Trait Implementations§

source§

impl CoreArrayProvider for RemoteProject

source§

impl PartialEq for RemoteProject

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ToOwned for RemoteProject

source§

type Owned = Ref<RemoteProject>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl Eq for RemoteProject

Auto Trait Implementations§

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<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<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.