pub struct RemoteProject { /* private fields */ }Implementations§
Source§impl RemoteProject
impl RemoteProject
Sourcepub fn is_open(&self) -> bool
pub fn is_open(&self) -> bool
Determine if the project is open (it needs to be opened before you can access its files)
Sourcepub fn open(&self) -> Result<(), ()>
pub fn open(&self) -> Result<(), ()>
Open the project, allowing various file and folder based apis to work, as well as connecting a core Project
Sourcepub fn open_with_progress<F: ProgressCallback>(
&self,
progress: F,
) -> Result<(), ()>
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
Sourcepub fn get_for_local_database(
database: &Database,
) -> Result<Option<Ref<Self>>, ()>
pub fn get_for_local_database( database: &Database, ) -> Result<Option<Ref<Self>>, ()>
Get the Remote Project for a Database
Sourcepub fn get_for_binaryview(bv: &BinaryView) -> Result<Option<Ref<Self>>, ()>
pub fn get_for_binaryview(bv: &BinaryView) -> Result<Option<Ref<Self>>, ()>
Get the Remote Project for a BinaryView
Sourcepub fn core_project(&self) -> Result<Ref<Project>, ()>
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.
Sourcepub fn created(&self) -> SystemTime
pub fn created(&self) -> SystemTime
Created date of the project
Sourcepub fn last_modified(&self) -> SystemTime
pub fn last_modified(&self) -> SystemTime
Last modification of the project
Sourcepub fn set_name(&self, name: &str) -> Result<(), ()>
pub fn set_name(&self, name: &str) -> Result<(), ()>
Set the description of the file. You will need to push the file to update the remote version.
Sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Desciprtion of the file
Sourcepub fn set_description(&self, description: &str) -> Result<(), ()>
pub fn set_description(&self, description: &str) -> Result<(), ()>
Set the description of the file. You will need to push the file to update the remote version.
Sourcepub fn received_file_count(&self) -> u64
pub fn received_file_count(&self) -> u64
Get the number of files in a project (without needing to pull them first)
Sourcepub fn received_folder_count(&self) -> u64
pub fn received_folder_count(&self) -> u64
Get the number of folders in a project (without needing to pull them first)
Sourcepub fn default_path(&self) -> Result<PathBuf, ()>
pub fn default_path(&self) -> Result<PathBuf, ()>
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.
Sourcepub fn has_pulled_files(&self) -> bool
pub fn has_pulled_files(&self) -> bool
If the project has pulled the folders yet
Sourcepub fn has_pulled_folders(&self) -> bool
pub fn has_pulled_folders(&self) -> bool
If the project has pulled the folders yet
Sourcepub fn has_pulled_group_permissions(&self) -> bool
pub fn has_pulled_group_permissions(&self) -> bool
If the project has pulled the group permissions yet
Sourcepub fn has_pulled_user_permissions(&self) -> bool
pub fn has_pulled_user_permissions(&self) -> bool
If the project has pulled the user permissions yet
Sourcepub fn is_admin(&self) -> bool
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).
Sourcepub fn files(&self) -> Result<Array<RemoteFile>, ()>
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.
Sourcepub fn get_file_by_id(&self, id: &str) -> Result<Option<Ref<RemoteFile>>, ()>
pub fn get_file_by_id(&self, id: &str) -> 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.
Sourcepub fn get_file_by_name(
&self,
name: &str,
) -> Result<Option<Ref<RemoteFile>>, ()>
pub fn get_file_by_name( &self, name: &str, ) -> 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.
Sourcepub fn pull_files(&self) -> Result<(), ()>
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.
Sourcepub fn pull_files_with_progress<P: ProgressCallback>(
&self,
progress: P,
) -> Result<(), ()>
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.
Sourcepub fn create_file(
&self,
filename: &str,
contents: &[u8],
name: &str,
description: &str,
parent_folder: Option<&RemoteFolder>,
file_type: RemoteFileType,
) -> Result<Ref<RemoteFile>, ()>
pub fn create_file( &self, filename: &str, contents: &[u8], name: &str, description: &str, 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 namecontents- File contentsname- Displayed file namedescription- File descriptionparent_folder- Folder that will contain the filefile_type- Type of File to create
Sourcepub fn create_file_with_progress<P>(
&self,
filename: &str,
contents: &[u8],
name: &str,
description: &str,
parent_folder: Option<&RemoteFolder>,
file_type: RemoteFileType,
progress: P,
) -> Result<Ref<RemoteFile>, ()>where
P: ProgressCallback,
pub fn create_file_with_progress<P>(
&self,
filename: &str,
contents: &[u8],
name: &str,
description: &str,
parent_folder: Option<&RemoteFolder>,
file_type: RemoteFileType,
progress: P,
) -> Result<Ref<RemoteFile>, ()>where
P: ProgressCallback,
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 namecontents- File contentsname- Displayed file namedescription- File descriptionparent_folder- Folder that will contain the filefile_type- Type of File to createprogress- Function to call on upload progress updates
Sourcepub fn push_file<I>(&self, file: &RemoteFile, extra_fields: I) -> Result<(), ()>
pub fn push_file<I>(&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.
pub fn delete_file(&self, file: &RemoteFile) -> Result<(), ()>
Sourcepub fn folders(&self) -> Result<Array<RemoteFolder>, ()>
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.
Sourcepub fn get_folder_by_id(
&self,
id: &str,
) -> Result<Option<Ref<RemoteFolder>>, ()>
pub fn get_folder_by_id( &self, id: &str, ) -> 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.
Sourcepub fn pull_folders(&self) -> Result<(), ()>
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.
Sourcepub fn pull_folders_with_progress<P: ProgressCallback>(
&self,
progress: P,
) -> Result<(), ()>
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.
Sourcepub fn create_folder(
&self,
name: &str,
description: &str,
parent_folder: Option<&RemoteFolder>,
) -> Result<Ref<RemoteFolder>, ()>
pub fn create_folder( &self, name: &str, description: &str, 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 namedescription- Folder descriptionparent- Parent folder (optional)
Sourcepub fn create_folder_with_progress<P>(
&self,
name: &str,
description: &str,
parent_folder: Option<&RemoteFolder>,
progress: P,
) -> Result<Ref<RemoteFolder>, ()>where
P: ProgressCallback,
pub fn create_folder_with_progress<P>(
&self,
name: &str,
description: &str,
parent_folder: Option<&RemoteFolder>,
progress: P,
) -> Result<Ref<RemoteFolder>, ()>where
P: ProgressCallback,
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 namedescription- Folder descriptionparent- Parent folder (optional)progress- Function to call on upload progress updates
Sourcepub fn push_folder<I>(
&self,
folder: &RemoteFolder,
extra_fields: I,
) -> Result<(), ()>
pub fn push_folder<I>( &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 updatedextra_fields- Extra HTTP fields to send with the update
Sourcepub fn delete_folder(&self, folder: &RemoteFolder) -> Result<(), ()>
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.
Sourcepub fn group_permissions(&self) -> Result<Array<Permission>, ()>
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.
Sourcepub fn user_permissions(&self) -> Result<Array<Permission>, ()>
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.
Sourcepub fn get_permission_by_id(
&self,
id: &str,
) -> Result<Option<Ref<Permission>>, ()>
pub fn get_permission_by_id( &self, id: &str, ) -> 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.
Sourcepub fn pull_group_permissions(&self) -> Result<(), ()>
pub fn pull_group_permissions(&self) -> Result<(), ()>
Pull the list of group permissions from the Remote.
Sourcepub fn pull_group_permissions_with_progress<F: ProgressCallback>(
&self,
progress: F,
) -> Result<(), ()>
pub fn pull_group_permissions_with_progress<F: ProgressCallback>( &self, progress: F, ) -> Result<(), ()>
Pull the list of group permissions from the Remote.
Sourcepub fn pull_user_permissions(&self) -> Result<(), ()>
pub fn pull_user_permissions(&self) -> Result<(), ()>
Pull the list of user permissions from the Remote.
Sourcepub fn pull_user_permissions_with_progress<F: ProgressCallback>(
&self,
progress: F,
) -> Result<(), ()>
pub fn pull_user_permissions_with_progress<F: ProgressCallback>( &self, progress: F, ) -> Result<(), ()>
Pull the list of user permissions from the Remote.
Sourcepub fn create_group_permission(
&self,
group_id: i64,
level: CollaborationPermissionLevel,
) -> Result<Ref<Permission>, ()>
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 idlevel- Permission level
Sourcepub fn create_group_permission_with_progress<F: ProgressCallback>(
&self,
group_id: i64,
level: CollaborationPermissionLevel,
progress: F,
) -> Result<Ref<Permission>, ()>
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 idlevel- Permission levelprogress- Function to call for upload progress updates
Sourcepub fn create_user_permission(
&self,
user_id: &str,
level: CollaborationPermissionLevel,
) -> Result<Ref<Permission>, ()>
pub fn create_user_permission( &self, user_id: &str, level: CollaborationPermissionLevel, ) -> Result<Ref<Permission>, ()>
Create a new user permission on the remote (and pull it).
§Arguments
user_id- User idlevel- Permission level
Sourcepub fn create_user_permission_with_progress<F: ProgressCallback>(
&self,
user_id: &str,
level: CollaborationPermissionLevel,
progress: F,
) -> Result<Ref<Permission>, ()>
pub fn create_user_permission_with_progress<F: ProgressCallback>( &self, user_id: &str, level: CollaborationPermissionLevel, progress: F, ) -> Result<Ref<Permission>, ()>
Create a new user permission on the remote (and pull it).
§Arguments
user_id- User idlevel- Permission levelprogress- The progress callback to call
Sourcepub fn push_permission<I>(
&self,
permission: &Permission,
extra_fields: I,
) -> Result<(), ()>
pub fn push_permission<I>( &self, permission: &Permission, extra_fields: I, ) -> Result<(), ()>
Push project permissions to the remote.
§Arguments
permission- Permission object which has been updatedextra_fields- Extra HTTP fields to send with the update
Sourcepub fn delete_permission(&self, permission: &Permission) -> Result<(), ()>
pub fn delete_permission(&self, permission: &Permission) -> Result<(), ()>
Delete a permission from the remote.
Sourcepub fn can_user_view(&self, username: &str) -> bool
pub fn can_user_view(&self, username: &str) -> bool
Determine if a user is in any of the view/edit/admin groups.
§Arguments
username- Username of user to check
Sourcepub fn can_user_edit(&self, username: &str) -> bool
pub fn can_user_edit(&self, username: &str) -> bool
Determine if a user is in any of the edit/admin groups.
§Arguments
username- Username of user to check
Sourcepub fn can_user_admin(&self, username: &str) -> bool
pub fn can_user_admin(&self, username: &str) -> bool
Sourcepub fn default_project_path(&self) -> String
pub fn default_project_path(&self) -> String
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.
Sourcepub fn upload_database<C>(
&self,
metadata: &FileMetadata,
parent_folder: Option<&RemoteFolder>,
name_changeset: C,
) -> Result<Ref<RemoteFile>, ()>where
C: NameChangeset,
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 databaseparent_folder- Optional parent folder in which to place this filename_changeset- Function to call for naming a pushed changeset, if necessary
Sourcepub 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,
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 databaseparent_folder- Optional parent folder in which to place this fileprogress-: Function to call for progress updatesname_changeset- Function to call for naming a pushed changeset, if necessary
Trait Implementations§
Source§impl CoreArrayProvider for RemoteProject
impl CoreArrayProvider for RemoteProject
Source§impl PartialEq for RemoteProject
impl PartialEq for RemoteProject
Source§impl ToOwned for RemoteProject
impl ToOwned for RemoteProject
Source§type Owned = Ref<RemoteProject>
type Owned = Ref<RemoteProject>
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 RemoteProject
Auto Trait Implementations§
impl Freeze for RemoteProject
impl RefUnwindSafe for RemoteProject
impl !Send for RemoteProject
impl !Sync for RemoteProject
impl Unpin for RemoteProject
impl UnwindSafe for RemoteProject
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