pub enum ProtectionKind {
ReadOnly,
Comments,
TrackedChanges,
Forms,
}Expand description
Which editing restrictions are enforced on a document (w:documentProtection/@w:edit,
ST_DocProtect) once Document.protection is Some. ST_DocProtect’s "none" value isn’t
modeled as its own variant — Document.protection: Option::None already expresses “no
restriction”, same convention as Highlight’s "none"/ VerticalAlign’s
"baseline"/UnderlineStyle’s "none" elsewhere in this crate.
Variants§
ReadOnly
Edits are restricted to regions delimited by matching range permissions — in practice, with none declared (this crate doesn’t model range permissions), this means no editing at all.
Comments
Edits are restricted to inserting/deleting comments (plus the same range-permission
carve-out as ReadOnly).
TrackedChanges
Edits are tracked as revisions, and applications shouldn’t allow turning tracking back off
while this is enforced — per ECMA-376, this value “shall imply the presence of the
trackRevisions element”, though this crate does not automatically set
Document.track_changes when this variant is used (best-effort, not validated, same posture
as Hyperlink::Internal’s anchor not being checked against a real bookmark).
Forms
Edits are restricted to form fields in sections marked as form-protected (this crate doesn’t
model per-section formProt, so in practice this behaves like ReadOnly for any document
it writes).
Implementations§
Source§impl ProtectionKind
impl ProtectionKind
Sourcepub fn attribute_value(self) -> &'static str
pub fn attribute_value(self) -> &'static str
This kind’s w:edit attribute value (ST_DocProtect).
Sourcepub fn from_attribute_value(value: &str) -> Option<ProtectionKind>
pub fn from_attribute_value(value: &str) -> Option<ProtectionKind>
Parses a w:edit attribute value (ST_DocProtect) into a ProtectionKind, or None for
"none" or any unrecognized value — mirrors this crate’s usual forgiving-on-read policy.
Trait Implementations§
Source§impl Clone for ProtectionKind
impl Clone for ProtectionKind
Source§fn clone(&self) -> ProtectionKind
fn clone(&self) -> ProtectionKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ProtectionKind
Source§impl Debug for ProtectionKind
impl Debug for ProtectionKind
impl Eq for ProtectionKind
Source§impl PartialEq for ProtectionKind
impl PartialEq for ProtectionKind
impl StructuralPartialEq for ProtectionKind
Auto Trait Implementations§
impl Freeze for ProtectionKind
impl RefUnwindSafe for ProtectionKind
impl Send for ProtectionKind
impl Sync for ProtectionKind
impl Unpin for ProtectionKind
impl UnsafeUnpin for ProtectionKind
impl UnwindSafe for ProtectionKind
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> 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
key and return true if they are equal.