#[non_exhaustive]pub struct Encryption {
pub user_password: Vec<u8>,
pub owner_password: Vec<u8>,
pub permissions: Permissions,
pub encrypt_metadata: bool,
}Expand description
How a document is to be encrypted on save (ISO 32000-2 §7.6.4.4).
#[non_exhaustive]; build one with Encryption::builder.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.user_password: Vec<u8>Opens the document with the rights permissions grants. Empty means
anyone can open it.
owner_password: Vec<u8>Opens the document with every right. Empty means the user password serves as both.
permissions: PermissionsWhat a reader who opened with the user password may do.
encrypt_metadata: boolWhether the document’s XMP metadata stream is enciphered too.
Implementations§
Source§impl Encryption
impl Encryption
Sourcepub fn builder() -> EncryptionBuilder
pub fn builder() -> EncryptionBuilder
A builder over the defaults: no passwords, every permission granted, and the metadata stream enciphered with the rest.
use pdfrum_edit::Encryption;
let encryption = Encryption::builder()
.user_password(b"open-me".to_vec())
.encrypt_metadata(false)
.build();
assert_eq!(encryption.user_password, b"open-me");
assert!(!encryption.encrypt_metadata);Trait Implementations§
Source§impl Clone for Encryption
impl Clone for Encryption
Source§impl Debug for Encryption
impl Debug for Encryption
impl Eq for Encryption
Source§impl PartialEq for Encryption
impl PartialEq for Encryption
impl StructuralPartialEq for Encryption
Auto Trait Implementations§
impl Freeze for Encryption
impl RefUnwindSafe for Encryption
impl Send for Encryption
impl Sync for Encryption
impl Unpin for Encryption
impl UnsafeUnpin for Encryption
impl UnwindSafe for Encryption
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> 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§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<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.