pub struct KeepConstraint {
pub keep_together: Keep,
pub keep_with_next: Keep,
pub keep_with_previous: Keep,
}Expand description
Keep constraint for page breaking
Represents the XSL-FO keep properties that control page breaking behavior.
§Examples
use fop_layout::layout::{Keep, KeepConstraint};
let mut constraint = KeepConstraint::new();
constraint.keep_together = Keep::Always;
assert!(constraint.must_keep_together());
constraint.keep_with_next = Keep::Always;
assert!(constraint.must_keep_with_next());Fields§
§keep_together: Keepkeep-together.within-page
keep_with_next: Keepkeep-with-next.within-page
keep_with_previous: Keepkeep-with-previous.within-page
Implementations§
Source§impl KeepConstraint
impl KeepConstraint
Sourcepub fn has_constraint(&self) -> bool
pub fn has_constraint(&self) -> bool
Check if any keep constraint is active
Sourcepub fn must_keep_together(&self) -> bool
pub fn must_keep_together(&self) -> bool
Check if keep-together is active
Sourcepub fn must_keep_with_next(&self) -> bool
pub fn must_keep_with_next(&self) -> bool
Check if keep-with-next is active
Sourcepub fn must_keep_with_previous(&self) -> bool
pub fn must_keep_with_previous(&self) -> bool
Check if keep-with-previous is active
Trait Implementations§
Source§impl Clone for KeepConstraint
impl Clone for KeepConstraint
Source§fn clone(&self) -> KeepConstraint
fn clone(&self) -> KeepConstraint
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeepConstraint
impl Debug for KeepConstraint
Source§impl Default for KeepConstraint
impl Default for KeepConstraint
Source§fn default() -> KeepConstraint
fn default() -> KeepConstraint
Returns the “default value” for a type. Read more
impl Copy for KeepConstraint
Auto Trait Implementations§
impl Freeze for KeepConstraint
impl RefUnwindSafe for KeepConstraint
impl Send for KeepConstraint
impl Sync for KeepConstraint
impl Unpin for KeepConstraint
impl UnsafeUnpin for KeepConstraint
impl UnwindSafe for KeepConstraint
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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().