pub enum Alignment {
Left,
Center,
Right,
}Expand description
How a line sits within the plate.
use pdfrum_doc::vt::Alignment;
// `/Q` names the three, and the default is flush left.
assert_eq!(Alignment::default(), Alignment::Left);
assert_eq!(Alignment::from_quadding(1), Alignment::Center);Variants§
Implementations§
Source§impl Alignment
impl Alignment
Sourcepub fn from_quadding(q: i64) -> Alignment
pub fn from_quadding(q: i64) -> Alignment
Reads a /Q value; anything outside 0..=2 is left-aligned.
use pdfrum_doc::vt::Alignment;
assert_eq!(Alignment::from_quadding(0), Alignment::Left);
assert_eq!(Alignment::from_quadding(2), Alignment::Right);
// Anything outside `0..=2` is left-aligned.
assert_eq!(Alignment::from_quadding(9), Alignment::Left);Sourcepub fn to_quadding(self) -> i64
pub fn to_quadding(self) -> i64
The /Q value for this alignment — the inverse of
from_quadding over the three it names.
Reading is lenient where writing is not: from_quadding takes any
unknown number as Left, so the round trip holds in this direction
only.
use pdfrum_doc::vt::Alignment;
for alignment in [Alignment::Left, Alignment::Center, Alignment::Right] {
assert_eq!(Alignment::from_quadding(alignment.to_quadding()), alignment);
}Trait Implementations§
impl Copy for Alignment
impl Eq for Alignment
impl StructuralPartialEq for Alignment
Auto Trait Implementations§
impl Freeze for Alignment
impl RefUnwindSafe for Alignment
impl Send for Alignment
impl Sync for Alignment
impl Unpin for Alignment
impl UnsafeUnpin for Alignment
impl UnwindSafe for Alignment
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