[−][src]Trait ironoxide::document::DocumentOps
Required methods
#[must_use]fn document_list<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<DocumentListResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<DocumentListResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
List all of the documents that the current user is able to decrypt.
Returns
DocumentListResult
struct with vec of metadata about each document the user can decrypt.
#[must_use]fn document_get_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DocumentId
) -> Pin<Box<dyn Future<Output = Result<DocumentMetadataResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
&'life0 self,
id: &'life1 DocumentId
) -> Pin<Box<dyn Future<Output = Result<DocumentMetadataResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get the metadata for a specific document given its ID.
Arguments
id
- Unique ID of the document to retrieve
Returns
DocumentMetadataResult
with details about the requested document.
fn document_get_id_from_bytes(
&self,
encrypted_document: &[u8]
) -> Result<DocumentId>
&self,
encrypted_document: &[u8]
) -> Result<DocumentId>
Attempt to parse the document ID out of an encrypted document.
Arguments
encrypted_document
- Encrypted document bytes
Returns
Result<DocumentId>
Fails if provided encrypted document has no header, otherwise returns extracted ID.
#[must_use]fn document_encrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
document_data: &'life1 [u8],
encrypt_opts: &'life2 DocumentEncryptOpts
) -> Pin<Box<dyn Future<Output = Result<DocumentEncryptResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
&'life0 self,
document_data: &'life1 [u8],
encrypt_opts: &'life2 DocumentEncryptOpts
) -> Pin<Box<dyn Future<Output = Result<DocumentEncryptResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Encrypt the provided document bytes.
Arguments
document_data
- Bytes of the document to encryptencrypt_opts
- Optional document encrypt parameters. Includesid
- Unique ID to use for the document. Document ID will be stored unencrypted and must be unique per segment.name
- Non-unique name to use in the document. Document name will not be encrypted.grant_to_author
- Flag determining whether to encrypt to the calling user or not. If set to false at least one value must be present in thegrant
list.grants
- List of users/groups to grant access to this document once encrypted
#[must_use]fn document_update_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 DocumentId,
new_document_data: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<DocumentEncryptResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
&'life0 self,
id: &'life1 DocumentId,
new_document_data: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<DocumentEncryptResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Update the encrypted content of an existing document. Persists any existing access to other users and groups.
Arguments
id
- ID of document to update.new_document_data
- Updated document content to encrypt.
#[must_use]fn document_decrypt<'life0, 'life1, 'async_trait>(
&'life0 self,
encrypted_document: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<DocumentDecryptResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
&'life0 self,
encrypted_document: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<DocumentDecryptResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Decrypts the provided encrypted document and returns details about the document as well as its decrypted bytes.
Arguments
encrypted_document
- Bytes of encrypted document. Should be the same bytes returned fromdocument_encrypt
.
Returns
Result<DocumentDecryptResult>
Includes metadata about the provided document as well as the decrypted document bytes.
#[must_use]fn document_update_name<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 DocumentId,
name: Option<&'life2 DocumentName>
) -> Pin<Box<dyn Future<Output = Result<DocumentMetadataResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
&'life0 self,
id: &'life1 DocumentId,
name: Option<&'life2 DocumentName>
) -> Pin<Box<dyn Future<Output = Result<DocumentMetadataResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Update a document name to a new value or clear its value.
Arguments
id
- ID of the document to updatename
- New name for the document. Provide a Some to update to a new name and a None to clear the name field.
Returns
Result<DocumentMetadataResult>
Metadata about the document that was updated.
#[must_use]fn document_grant_access<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
document_id: &'life1 DocumentId,
grant_list: &'life2 Vec<UserOrGroup>
) -> Pin<Box<dyn Future<Output = Result<DocumentAccessResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
&'life0 self,
document_id: &'life1 DocumentId,
grant_list: &'life2 Vec<UserOrGroup>
) -> Pin<Box<dyn Future<Output = Result<DocumentAccessResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Grant access to a document. Recipients of document access can be either users or groups.
Arguments
document_id
- id of the document whose access is is being modified
grant_list
- list of grants. Elements represent either a user or a group.
Returns
Outer result indicates that the request failed either on the client or that the server rejected
the whole request. If the outer result is Ok
then each individual grant to a user/group
either succeeded or failed.
#[must_use]fn document_revoke_access<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
document_id: &'life1 DocumentId,
revoke_list: &'life2 Vec<UserOrGroup>
) -> Pin<Box<dyn Future<Output = Result<DocumentAccessResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
&'life0 self,
document_id: &'life1 DocumentId,
revoke_list: &'life2 Vec<UserOrGroup>
) -> Pin<Box<dyn Future<Output = Result<DocumentAccessResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Revoke access from a document. Revocation of document access can be either users or groups.
Arguments
document_id
- id of the document whose access is is being modified
revoke_list
- List of revokes. Elements represent either a user or a group.
Returns
Outer result indicates that the request failed either on the client or that the server rejected
the whole request. If the outer result is Ok
then each individual revoke from a user/group
either succeeded or failed.
Implementors
impl DocumentOps for IronOxide
[src]
fn document_list<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<DocumentListResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<DocumentListResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn document_get_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DocumentId
) -> Pin<Box<dyn Future<Output = Result<DocumentMetadataResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 DocumentId
) -> Pin<Box<dyn Future<Output = Result<DocumentMetadataResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn document_get_id_from_bytes(
&self,
encrypted_document: &[u8]
) -> Result<DocumentId>
[src]
&self,
encrypted_document: &[u8]
) -> Result<DocumentId>
fn document_encrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
document_data: &'life1 [u8],
encrypt_opts: &'life2 DocumentEncryptOpts
) -> Pin<Box<dyn Future<Output = Result<DocumentEncryptResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
document_data: &'life1 [u8],
encrypt_opts: &'life2 DocumentEncryptOpts
) -> Pin<Box<dyn Future<Output = Result<DocumentEncryptResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn document_update_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 DocumentId,
new_document_data: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<DocumentEncryptResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 DocumentId,
new_document_data: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<DocumentEncryptResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn document_decrypt<'life0, 'life1, 'async_trait>(
&'life0 self,
encrypted_document: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<DocumentDecryptResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
encrypted_document: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<DocumentDecryptResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn document_update_name<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 DocumentId,
name: Option<&'life2 DocumentName>
) -> Pin<Box<dyn Future<Output = Result<DocumentMetadataResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 DocumentId,
name: Option<&'life2 DocumentName>
) -> Pin<Box<dyn Future<Output = Result<DocumentMetadataResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn document_grant_access<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 DocumentId,
grant_list: &'life2 Vec<UserOrGroup>
) -> Pin<Box<dyn Future<Output = Result<DocumentAccessResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 DocumentId,
grant_list: &'life2 Vec<UserOrGroup>
) -> Pin<Box<dyn Future<Output = Result<DocumentAccessResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn document_revoke_access<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 DocumentId,
revoke_list: &'life2 Vec<UserOrGroup>
) -> Pin<Box<dyn Future<Output = Result<DocumentAccessResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 DocumentId,
revoke_list: &'life2 Vec<UserOrGroup>
) -> Pin<Box<dyn Future<Output = Result<DocumentAccessResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,