#[non_exhaustive]pub enum AnnotLinkAction {
Uri(String),
GoTo {
page: ObjRef,
view: AnnotGoToView,
},
Named {
name: String,
page: ObjRef,
view: AnnotGoToView,
},
NamedExisting {
name: String,
},
GoToR {
file: String,
dest: AnnotRemoteDest,
new_window: Option<bool>,
},
Launch {
file: String,
},
}Expand description
Write-side link action, aligned with pdfrum_doc::ActionKind values we
support on annotations.
Reuses the document Action model conceptually (URI, GoTo); this enum is
the typed payload AnnotSpec::Link writes into /A. A Self::Named
action also upserts /Names /Dests so reopen/navigation can resolve the
name (see set_named_destination). Self::NamedExisting writes the
same /D string but does not touch the name tree — use it when the
destination is already registered.
use pdfrum_edit::AnnotLinkAction;
let a = AnnotLinkAction::Uri("https://example.test/".into());
assert!(matches!(a, AnnotLinkAction::Uri(_)));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Uri(String)
Resolve a URI (/S /URI).
GoTo
Go to a page in this document (/S /GoTo with an explicit destination
array naming page).
Fields
page: ObjRefPage object reference (the same refs crate::EditDoc::page_state returns).
view: AnnotGoToViewHow to display that page.
Named
GoTo whose /D is a named destination string.
Also registers (or updates) name under the catalog /Names /Dests
tree so pdfrum_doc::nav::lookup_named_dest can resolve it after save.
Fields
view: AnnotGoToViewHow to display that page.
NamedExisting
GoTo whose /D is a named destination that must already exist.
Unlike Self::Named, this does not upsert /Names /Dests — the
name is assumed to resolve already (or will be registered separately
via set_named_destination).
GoToR
Remote go-to (/S /GoToR): open file at AnnotRemoteDest.
/F is written as a filespec dictionary with /F and /UF.
Fields
dest: AnnotRemoteDestPage number + view, or a remote named destination.
Launch
Launch a file / application (/S /Launch).
/F is written as a filespec dictionary with /F and /UF.
Trait Implementations§
Source§impl Clone for AnnotLinkAction
impl Clone for AnnotLinkAction
Source§impl Debug for AnnotLinkAction
impl Debug for AnnotLinkAction
Source§impl PartialEq for AnnotLinkAction
impl PartialEq for AnnotLinkAction
impl StructuralPartialEq for AnnotLinkAction
Auto Trait Implementations§
impl Freeze for AnnotLinkAction
impl RefUnwindSafe for AnnotLinkAction
impl Send for AnnotLinkAction
impl Sync for AnnotLinkAction
impl Unpin for AnnotLinkAction
impl UnsafeUnpin for AnnotLinkAction
impl UnwindSafe for AnnotLinkAction
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<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
T, using the provided data to resolve any offsets.