pub enum PdfAction<'a> {
LocalDestination(PdfActionLocalDestination<'a>),
RemoteDestination(PdfActionRemoteDestination<'a>),
EmbeddedDestination(PdfActionEmbeddedDestination<'a>),
Launch(PdfActionLaunch<'a>),
Uri(PdfActionUri<'a>),
Unsupported(PdfActionUnsupported<'a>),
}Expand description
The action associated with a clickable link or document bookmark.
Variants§
LocalDestination(PdfActionLocalDestination<'a>)
RemoteDestination(PdfActionRemoteDestination<'a>)
EmbeddedDestination(PdfActionEmbeddedDestination<'a>)
Launch(PdfActionLaunch<'a>)
Uri(PdfActionUri<'a>)
Unsupported(PdfActionUnsupported<'a>)
Implementations§
Source§impl<'a> PdfAction<'a>
impl<'a> PdfAction<'a>
Sourcepub fn action_type(&self) -> PdfActionType
pub fn action_type(&self) -> PdfActionType
Returns the PdfActionType for this PdfAction.
Note that Pdfium does not support or recognize all PDF action types. For instance, Pdfium does not currently support or recognize the interactive Javascript action type supported by Adobe Acrobat or Foxit’s commercial PDF SDK. In these cases, Pdfium will return PdfActionType::Unsupported.
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Returns true if this PdfAction has an action type other than PdfActionType::Unsupported.
The PdfAction::as_local_destination_action(), PdfAction::as_remote_destination_action(), PdfAction::as_embedded_destination_action(), PdfAction::as_launch_action(), and PdfAction::as_uri_action() functions can be used to access properties and functions pertaining to a specific action type.
Sourcepub fn is_unsupported(&self) -> bool
pub fn is_unsupported(&self) -> bool
Returns true if this PdfAction has an action type of PdfActionType::Unsupported.
Common properties shared by all PdfAction types can still be accessed for actions not recognized by Pdfium, but action-specific functionality will be unavailable.
Sourcepub fn as_local_destination_action(
&self,
) -> Option<&PdfActionLocalDestination<'_>>
pub fn as_local_destination_action( &self, ) -> Option<&PdfActionLocalDestination<'_>>
Returns an immutable reference to the underlying PdfActionLocalDestination for this PdfAction, if this action has an action type of PdfActionType::GoToDestinationInSameDocument.
Sourcepub fn as_local_destination_action_mut(
&mut self,
) -> Option<&mut PdfActionLocalDestination<'a>>
pub fn as_local_destination_action_mut( &mut self, ) -> Option<&mut PdfActionLocalDestination<'a>>
Returns a mutable reference to the underlying PdfActionLocalDestination for this PdfAction, if this action has an action type of PdfActionType::GoToDestinationInSameDocument.
Sourcepub fn as_remote_destination_action(
&self,
) -> Option<&PdfActionRemoteDestination<'_>>
pub fn as_remote_destination_action( &self, ) -> Option<&PdfActionRemoteDestination<'_>>
Returns an immutable reference to the underlying PdfActionRemoteDestination for this PdfAction, if this action has an action type of PdfActionType::GoToDestinationInRemoteDocument.
Sourcepub fn as_remote_destination_action_mut(
&mut self,
) -> Option<&mut PdfActionRemoteDestination<'a>>
pub fn as_remote_destination_action_mut( &mut self, ) -> Option<&mut PdfActionRemoteDestination<'a>>
Returns a mutable reference to the underlying PdfActionRemoteDestination for this PdfAction, if this action has an action type of PdfActionType::GoToDestinationInRemoteDocument.
Sourcepub fn as_embedded_destination_action(
&self,
) -> Option<&PdfActionEmbeddedDestination<'_>>
pub fn as_embedded_destination_action( &self, ) -> Option<&PdfActionEmbeddedDestination<'_>>
Returns an immutable reference to the underlying PdfActionEmbeddedDestination for this PdfAction, if this action has an action type of PdfActionType::GoToDestinationInEmbeddedDocument.
Sourcepub fn as_embedded_destination_action_mut(
&mut self,
) -> Option<&mut PdfActionEmbeddedDestination<'a>>
pub fn as_embedded_destination_action_mut( &mut self, ) -> Option<&mut PdfActionEmbeddedDestination<'a>>
Returns a mutable reference to the underlying PdfActionEmbeddedDestination for this PdfAction, if this action has an action type of PdfActionType::GoToDestinationInEmbeddedDocument.
Sourcepub fn as_launch_action(&self) -> Option<&PdfActionLaunch<'_>>
pub fn as_launch_action(&self) -> Option<&PdfActionLaunch<'_>>
Returns an immutable reference to the underlying PdfActionLaunch for this PdfAction, if this action has an action type of PdfActionType::Launch.
Sourcepub fn as_launch_action_mut(&mut self) -> Option<&mut PdfActionLaunch<'a>>
pub fn as_launch_action_mut(&mut self) -> Option<&mut PdfActionLaunch<'a>>
Returns a mutable reference to the underlying PdfActionLaunch for this PdfAction, if this action has an action type of PdfActionType::Launch.
Sourcepub fn as_uri_action(&self) -> Option<&PdfActionUri<'_>>
pub fn as_uri_action(&self) -> Option<&PdfActionUri<'_>>
Returns an immutable reference to the underlying PdfActionUri for this PdfAction, if this action has an action type of PdfActionType::Uri.
Sourcepub fn as_uri_action_mut(&mut self) -> Option<&mut PdfActionUri<'a>>
pub fn as_uri_action_mut(&mut self) -> Option<&mut PdfActionUri<'a>>
Returns a mutable reference to the underlying PdfActionUri for this PdfAction, if this action has an action type of PdfActionType::Uri.
Trait Implementations§
Source§impl<'a> From<PdfActionEmbeddedDestination<'a>> for PdfAction<'a>
impl<'a> From<PdfActionEmbeddedDestination<'a>> for PdfAction<'a>
Source§fn from(action: PdfActionEmbeddedDestination<'a>) -> Self
fn from(action: PdfActionEmbeddedDestination<'a>) -> Self
Source§impl<'a> From<PdfActionLaunch<'a>> for PdfAction<'a>
impl<'a> From<PdfActionLaunch<'a>> for PdfAction<'a>
Source§fn from(action: PdfActionLaunch<'a>) -> Self
fn from(action: PdfActionLaunch<'a>) -> Self
Source§impl<'a> From<PdfActionLocalDestination<'a>> for PdfAction<'a>
impl<'a> From<PdfActionLocalDestination<'a>> for PdfAction<'a>
Source§fn from(action: PdfActionLocalDestination<'a>) -> Self
fn from(action: PdfActionLocalDestination<'a>) -> Self
Source§impl<'a> From<PdfActionRemoteDestination<'a>> for PdfAction<'a>
impl<'a> From<PdfActionRemoteDestination<'a>> for PdfAction<'a>
Source§fn from(action: PdfActionRemoteDestination<'a>) -> Self
fn from(action: PdfActionRemoteDestination<'a>) -> Self
Source§impl<'a> From<PdfActionUnsupported<'a>> for PdfAction<'a>
impl<'a> From<PdfActionUnsupported<'a>> for PdfAction<'a>
Source§fn from(action: PdfActionUnsupported<'a>) -> Self
fn from(action: PdfActionUnsupported<'a>) -> Self
Source§impl<'a> From<PdfActionUri<'a>> for PdfAction<'a>
impl<'a> From<PdfActionUri<'a>> for PdfAction<'a>
Source§fn from(action: PdfActionUri<'a>) -> Self
fn from(action: PdfActionUri<'a>) -> Self
Auto Trait Implementations§
impl<'a> Freeze for PdfAction<'a>
impl<'a> !RefUnwindSafe for PdfAction<'a>
impl<'a> !Send for PdfAction<'a>
impl<'a> !Sync for PdfAction<'a>
impl<'a> Unpin for PdfAction<'a>
impl<'a> !UnwindSafe for PdfAction<'a>
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> 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>
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>
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