pub struct PasswordOptions {
pub user_password: String,
pub owner_password: String,
pub encryption_level: EncryptionLevel,
pub permissions: PdfPermissions,
}
Expand description
Password options for PDF encryption.
Fields§
§user_password: String
User password (for opening the document)
owner_password: String
Owner password (for full access/editing)
encryption_level: EncryptionLevel
Encryption level
permissions: PdfPermissions
Permissions for the document
Implementations§
Source§impl PasswordOptions
impl PasswordOptions
Sourcepub fn new<S1: Into<String>, S2: Into<String>>(
user_password: S1,
owner_password: S2,
) -> Self
pub fn new<S1: Into<String>, S2: Into<String>>( user_password: S1, owner_password: S2, ) -> Self
Create new password options with user and owner passwords. Uses AES-256 encryption by default for maximum security.
Sourcepub fn with_encryption_level(self, level: EncryptionLevel) -> Self
pub fn with_encryption_level(self, level: EncryptionLevel) -> Self
Set the encryption level.
Sourcepub fn with_permissions(self, permissions: PdfPermissions) -> Self
pub fn with_permissions(self, permissions: PdfPermissions) -> Self
Set the permissions.
Trait Implementations§
Source§impl Clone for PasswordOptions
impl Clone for PasswordOptions
Source§fn clone(&self) -> PasswordOptions
fn clone(&self) -> PasswordOptions
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 moreAuto Trait Implementations§
impl Freeze for PasswordOptions
impl RefUnwindSafe for PasswordOptions
impl Send for PasswordOptions
impl Sync for PasswordOptions
impl Unpin for PasswordOptions
impl UnwindSafe for PasswordOptions
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<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