pub enum ApMode {
Normal,
Rollover,
Down,
}Expand description
Which appearance a lookup wants.
use pdfrum_doc::annot::{ApMode, annot_ap, has_appearance};
use pdfrum_object::{ByteSpan, Dict, Name, NoResolve, Object, Stream};
let normal = Stream::new(Dict::default(), ByteSpan::whole(b"0 0 10 10 re f".as_slice().into()));
let annot = Dict::from_pairs([(
Name::from("AP"),
Object::Dict(Dict::from_pairs([(
Name::from("N"),
Object::Stream(Box::new(normal)),
)])),
)]);
// A missing `/R` falls back to `/N` when the caller allows it.
assert!(annot_ap(&annot, ApMode::Rollover, true, &NoResolve).is_some());
assert!(annot_ap(&annot, ApMode::Rollover, false, &NoResolve).is_none());Variants§
Normal
The normal appearance (/N).
Rollover
The rollover appearance (/R).
Down
The pressed appearance (/D).
Trait Implementations§
impl Copy for ApMode
impl Eq for ApMode
impl StructuralPartialEq for ApMode
Auto Trait Implementations§
impl Freeze for ApMode
impl RefUnwindSafe for ApMode
impl Send for ApMode
impl Sync for ApMode
impl Unpin for ApMode
impl UnsafeUnpin for ApMode
impl UnwindSafe for ApMode
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