#[non_exhaustive]pub struct VectorRule {
pub x1: f32,
pub y1: f32,
pub x2: f32,
pub y2: f32,
pub line_width: f32,
}Expand description
A ruling line or table/box border extracted from a page’s vector graphics.
Coordinates use PDF bottom-left origin, in PDF points.
Obtain via extract_vector_rules (free function) or
crate::Document::extract_vector_rules (convenience method on a loaded document).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.x1: f32Start x coordinate.
y1: f32Start y coordinate (bottom-left origin).
x2: f32End x coordinate.
y2: f32End y coordinate.
line_width: f32Effective stroke/fill width in PDF points.
Implementations§
Source§impl VectorRule
impl VectorRule
Sourcepub fn new(x1: f32, y1: f32, x2: f32, y2: f32, line_width: f32) -> Self
pub fn new(x1: f32, y1: f32, x2: f32, y2: f32, line_width: f32) -> Self
Construct a VectorRule from endpoint coordinates and a line width.
Sourcepub fn is_horizontal(&self) -> bool
pub fn is_horizontal(&self) -> bool
Returns true when the rule spans more in X than Y (approximately horizontal).
Sourcepub fn is_vertical(&self) -> bool
pub fn is_vertical(&self) -> bool
Returns true when the rule spans more in Y than X (approximately vertical).
Trait Implementations§
Source§impl Clone for VectorRule
impl Clone for VectorRule
Source§fn clone(&self) -> VectorRule
fn clone(&self) -> VectorRule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VectorRule
impl RefUnwindSafe for VectorRule
impl Send for VectorRule
impl Sync for VectorRule
impl Unpin for VectorRule
impl UnsafeUnpin for VectorRule
impl UnwindSafe for VectorRule
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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