pub struct DocumentEncryptOpts { /* private fields */ }Expand description
Parameters that can be provided when encrypting a new document.
Document IDs must be unique to the segment. If no ID is provided, one will be generated for it. If no name is provided, the document’s name will be left empty. Neither the document’s ID nor name will be encrypted.
Default values are provided with DocumentEncryptOpts::default().
Implementations§
Source§impl DocumentEncryptOpts
impl DocumentEncryptOpts
Sourcepub fn new(
id: Option<DocumentId>,
name: Option<DocumentName>,
grants: EitherOrBoth<ExplicitGrant, PolicyGrant>,
) -> DocumentEncryptOpts
pub fn new( id: Option<DocumentId>, name: Option<DocumentName>, grants: EitherOrBoth<ExplicitGrant, PolicyGrant>, ) -> DocumentEncryptOpts
Constructs a new DocumentEncryptOpts.
Document encryption requires an ExplicitGrant, a PolicyGrant, or both. If only using one type
of grant, consider using with_explicit_grants
or with_policy_grants instead.
§Arguments
id- ID to use for the document.name- Name to use for the document.grants- Grants that control who will have access to read and decrypt this document.
Sourcepub fn with_explicit_grants(
id: Option<DocumentId>,
name: Option<DocumentName>,
grant_to_author: bool,
grants: Vec<UserOrGroup>,
) -> DocumentEncryptOpts
pub fn with_explicit_grants( id: Option<DocumentId>, name: Option<DocumentName>, grant_to_author: bool, grants: Vec<UserOrGroup>, ) -> DocumentEncryptOpts
Constructs a new DocumentEncryptOpts with access explicitly granted to certain users and groups.
§Arguments
id- ID to use for the document.name- Name to use for the document.grant_to_author-trueif the calling user should have access to decrypt the documentgrants- List of users and groups that should have access to read and decrypt this document
Sourcepub fn with_policy_grants(
id: Option<DocumentId>,
name: Option<DocumentName>,
policy: PolicyGrant,
) -> DocumentEncryptOpts
pub fn with_policy_grants( id: Option<DocumentId>, name: Option<DocumentName>, policy: PolicyGrant, ) -> DocumentEncryptOpts
Trait Implementations§
Source§impl Clone for DocumentEncryptOpts
impl Clone for DocumentEncryptOpts
Source§fn clone(&self) -> DocumentEncryptOpts
fn clone(&self) -> DocumentEncryptOpts
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DocumentEncryptOpts
impl Debug for DocumentEncryptOpts
Source§impl Default for DocumentEncryptOpts
impl Default for DocumentEncryptOpts
Source§impl Hash for DocumentEncryptOpts
impl Hash for DocumentEncryptOpts
Source§impl PartialEq for DocumentEncryptOpts
impl PartialEq for DocumentEncryptOpts
impl Eq for DocumentEncryptOpts
impl StructuralPartialEq for DocumentEncryptOpts
Auto Trait Implementations§
impl Freeze for DocumentEncryptOpts
impl RefUnwindSafe for DocumentEncryptOpts
impl Send for DocumentEncryptOpts
impl Sync for DocumentEncryptOpts
impl Unpin for DocumentEncryptOpts
impl UnsafeUnpin for DocumentEncryptOpts
impl UnwindSafe for DocumentEncryptOpts
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
Mutably borrows from an owned value. Read more
Source§impl<T> Clear for Twhere
T: InitializableFromZeroed + ?Sized,
impl<T> Clear for Twhere
T: InitializableFromZeroed + ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> InitializableFromZeroed for Twhere
T: Default,
impl<T> InitializableFromZeroed for Twhere
T: Default,
Source§unsafe fn initialize(place: *mut T)
unsafe fn initialize(place: *mut T)
Called to initialize a place to a valid value, after it is set
to all-bits-zero. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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