binaryninja::collaboration

Struct Remote

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

Implementations§

source§

impl Remote

source

pub fn new<N: BnStrCompatible, A: BnStrCompatible>( name: N, address: A, ) -> Ref<Self>

Create a Remote and add it to the list of known remotes (saved to Settings)

source

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

Get the Remote for a Database

source

pub fn get_for_binary_view(bv: &BinaryView) -> Result<Option<Ref<Remote>>, ()>

Get the Remote for a Binary View

source

pub fn has_loaded_metadata(&self) -> bool

Checks if the remote has pulled metadata like its id, etc.

source

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

Gets the unique id. If metadata has not been pulled, it will be pulled upon calling this.

source

pub fn name(&self) -> BnString

Gets the name of the remote.

source

pub fn address(&self) -> BnString

Gets the address of the remote.

source

pub fn is_connected(&self) -> bool

Checks if the remote is connected.

source

pub fn username(&self) -> BnString

Gets the username used to connect to the remote.

source

pub fn token(&self) -> BnString

Gets the token used to connect to the remote.

source

pub fn server_version(&self) -> Result<i32, ()>

Gets the server version. If metadata has not been pulled, it will be pulled upon calling this.

source

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

Gets the server build id. If metadata has not been pulled, it will be pulled upon calling this.

source

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

Gets the list of supported authentication backends on the server. If metadata has not been pulled, it will be pulled upon calling this.

source

pub fn is_admin(&self) -> Result<bool, ()>

Checks if the current user is an administrator.

source

pub fn is_enterprise(&self) -> Result<bool, ()>

Checks if the remote is the same as the Enterprise License server.

source

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

Loads metadata from the remote, including unique id and versions.

source

pub fn request_authentication_token<U: BnStrCompatible, P: BnStrCompatible>( &self, username: U, password: P, ) -> Option<BnString>

Requests an authentication token using a username and password.

source

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

Connects to the Remote, loading metadata and optionally acquiring a token.

Use Remote::connect_with_opts if you cannot otherwise automatically connect using enterprise.

WARNING: This is currently not thread safe, if you try and connect/disconnect to a remote on multiple threads you will be subject to race conditions. To avoid this wrap the Remote in a synchronization primitive, and pass that to your threads. Or don’t try and connect on multiple threads.

source

pub fn connect_with_opts(&self, options: ConnectionOptions) -> Result<(), ()>

source

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

Disconnects from the remote.

WARNING: This is currently not thread safe, if you try and connect/disconnect to a remote on multiple threads you will be subject to race conditions. To avoid this wrap the Remote in a synchronization primitive, and pass that to your threads. Or don’t try and connect on multiple threads.

source

pub fn has_pulled_projects(&self) -> bool

Checks if the project has pulled the projects yet.

source

pub fn has_pulled_groups(&self) -> bool

Checks if the project has pulled the groups yet.

source

pub fn has_pulled_users(&self) -> bool

Checks if the project has pulled the users yet.

source

pub fn projects(&self) -> Result<Array<RemoteProject>, ()>

Gets the list of projects in this project.

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

source

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

Gets a specific project in the Remote by its id.

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

source

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

Gets a specific project in the Remote by its name.

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

source

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

Pulls the list of projects from the Remote.

source

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

Pulls the list of projects from the Remote.

§Arguments
  • progress - Function to call for progress updates
source

pub fn create_project<N: BnStrCompatible, D: BnStrCompatible>( &self, name: N, description: D, ) -> Result<Ref<RemoteProject>, ()>

Creates a new project on the remote (and pull it).

§Arguments
  • name - Project name
  • description - Project description
source

pub fn import_local_project( &self, project: &Project, ) -> Option<Ref<RemoteProject>>

Create a new project on the remote from a local project.

source

pub fn import_local_project_with_progress<P: ProgressCallback>( &self, project: &Project, progress: P, ) -> Option<Ref<RemoteProject>>

Create a new project on the remote from a local project.

source

pub fn push_project<I, K, V>( &self, project: &RemoteProject, extra_fields: I, ) -> Result<(), ()>

Pushes an updated Project object to the Remote.

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

pub fn delete_project(&self, project: &RemoteProject) -> Result<(), ()>

Deletes a project from the remote.

source

pub fn groups(&self) -> Result<Array<RemoteGroup>, ()>

Gets the list of groups in this project.

If groups have not been pulled, they will be pulled upon calling this. This function is only available to accounts with admin status on the Remote.

source

pub fn get_group_by_id( &self, id: GroupId, ) -> Result<Option<Ref<RemoteGroup>>, ()>

Gets a specific group in the Remote by its id.

If groups have not been pulled, they will be pulled upon calling this. This function is only available to accounts with admin status on the Remote.

source

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

Gets a specific group in the Remote by its name.

If groups have not been pulled, they will be pulled upon calling this. This function is only available to accounts with admin status on the Remote.

source

pub fn search_groups<S: BnStrCompatible>( &self, prefix: S, ) -> Result<(Array<GroupId>, Array<BnString>), ()>

Searches for groups in the Remote with a given prefix.

§Arguments
  • prefix - Prefix of name for groups
source

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

Pulls the list of groups from the Remote. This function is only available to accounts with admin status on the Remote.

source

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

Pulls the list of groups from the Remote. This function is only available to accounts with admin status on the Remote.

§Arguments
  • progress - Function to call for progress updates
source

pub fn create_group<N, I>( &self, name: N, usernames: I, ) -> Result<Ref<RemoteGroup>, ()>

Creates a new group on the remote (and pull it). This function is only available to accounts with admin status on the Remote.

§Arguments
  • name - Group name
  • usernames - List of usernames of users in the group
source

pub fn push_group<I, K, V>( &self, group: &RemoteGroup, extra_fields: I, ) -> Result<(), ()>

Pushes an updated Group object to the Remote. This function is only available to accounts with admin status on the Remote.

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

pub fn delete_group(&self, group: &RemoteGroup) -> Result<(), ()>

Deletes the specified group from the remote.

NOTE: This function is only available to accounts with admin status on the Remote

§Arguments
  • group - Reference to the group to delete.
source

pub fn users(&self) -> Result<Array<RemoteUser>, ()>

Retrieves the list of users in the project.

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

NOTE: This function is only available to accounts with admin status on the Remote

source

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

Retrieves a specific user in the project by their ID.

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

NOTE: This function is only available to accounts with admin status on the Remote

§Arguments
  • id - The identifier of the user to retrieve.
source

pub fn get_user_by_username<S: BnStrCompatible>( &self, username: S, ) -> Result<Option<Ref<RemoteUser>>, ()>

Retrieves a specific user in the project by their username.

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

NOTE: This function is only available to accounts with admin status on the Remote

§Arguments
  • username - The username of the user to retrieve.
source

pub fn current_user(&self) -> Result<Option<Ref<RemoteUser>>, ()>

Retrieves the user object for the currently connected user.

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

NOTE: This function is only available to accounts with admin status on the Remote

source

pub fn search_users<S: BnStrCompatible>( &self, prefix: S, ) -> Result<(Array<BnString>, Array<BnString>), ()>

Searches for users in the project with a given prefix.

§Arguments
  • prefix - The prefix to search for in usernames.
source

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

Pulls the list of users from the remote.

NOTE: This function is only available to accounts with admin status on the Remote. Non-admin accounts attempting to call this function will pull an empty list of users.

source

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

Pulls the list of users from the remote.

NOTE: This function is only available to accounts with admin status on the Remote. Non-admin accounts attempting to call this function will pull an empty list of users.

§Arguments
  • progress - Closure called to report progress. Takes current and total progress counts.
source

pub fn create_user<U: BnStrCompatible, E: BnStrCompatible, P: BnStrCompatible>( &self, username: U, email: E, is_active: bool, password: P, group_ids: &[u64], user_permission_ids: &[u64], ) -> Result<Ref<RemoteUser>, ()>

Creates a new user on the remote and returns a reference to the created user.

NOTE: This function is only available to accounts with admin status on the Remote

§Arguments
  • Various details about the new user to be created.
source

pub fn push_user<I, K, V>( &self, user: &RemoteUser, extra_fields: I, ) -> Result<(), ()>

Pushes updates to the specified user on the remote.

NOTE: This function is only available to accounts with admin status on the Remote

§Arguments
  • user - Reference to the RemoteUser object to push.
  • extra_fields - Optional extra fields to send with the update.

Trait Implementations§

source§

impl CoreArrayProvider for Remote

source§

impl PartialEq for Remote

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 Remote

source§

type Owned = Ref<Remote>

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 Remote

Auto Trait Implementations§

§

impl Freeze for Remote

§

impl RefUnwindSafe for Remote

§

impl !Send for Remote

§

impl !Sync for Remote

§

impl Unpin for Remote

§

impl UnwindSafe for Remote

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.