pub struct PageBoundarySignature(ContentHash);Expand description
A compact, deterministic digest of one laid-out Page’s break-defining
content (design note §4.5).
Equal for identical pagination of identical content, different when a page’s
content or its break changes. It is the cache slot’s staleness check, not a
human-readable description: use content_hash to read
the underlying value.
§Examples
use mos_layout::{LayoutEngine, PageBoundarySignature};
use mos_core::Document;
use std::path::PathBuf;
let doc = Document::new(PathBuf::from("doc.mos"));
let result = LayoutEngine::new().layout(&doc);
// Re-signing the same page yields the same signature.
for page in &result.graph.pages {
assert_eq!(
PageBoundarySignature::of_page(page),
PageBoundarySignature::of_page(page),
);
}Tuple Fields§
§0: ContentHashImplementations§
Source§impl PageBoundarySignature
impl PageBoundarySignature
Sourcepub const fn content_hash(self) -> ContentHash
pub const fn content_hash(self) -> ContentHash
The underlying content hash.
Trait Implementations§
Source§impl Clone for PageBoundarySignature
impl Clone for PageBoundarySignature
Source§fn clone(&self) -> PageBoundarySignature
fn clone(&self) -> PageBoundarySignature
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 PageBoundarySignature
impl Debug for PageBoundarySignature
Source§impl Hash for PageBoundarySignature
impl Hash for PageBoundarySignature
Source§impl Ord for PageBoundarySignature
impl Ord for PageBoundarySignature
Source§fn cmp(&self, other: &PageBoundarySignature) -> Ordering
fn cmp(&self, other: &PageBoundarySignature) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PageBoundarySignature
impl PartialEq for PageBoundarySignature
Source§impl PartialOrd for PageBoundarySignature
impl PartialOrd for PageBoundarySignature
impl Copy for PageBoundarySignature
impl Eq for PageBoundarySignature
impl StructuralPartialEq for PageBoundarySignature
Auto Trait Implementations§
impl Freeze for PageBoundarySignature
impl RefUnwindSafe for PageBoundarySignature
impl Send for PageBoundarySignature
impl Sync for PageBoundarySignature
impl Unpin for PageBoundarySignature
impl UnsafeUnpin for PageBoundarySignature
impl UnwindSafe for PageBoundarySignature
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.