pub struct DefaultCost(pub i32, pub i32);Expand description
The default cost type used for documents.
It is composed of two values: the badness and the number of newlines. The badness quantifies how much the layout overflows the desired page width. When this cost is used, the badness will be minimized first, then the number of newlines will be minimized from there.
This cost is generally used with the DefaultCostFactory, but it is valid
to use it with a custom cost factory if it serves your needs.
Tuple Fields§
§0: i32The badness of the layout.
1: i32The number of newlines the layout produced.
Trait Implementations§
Source§impl Add for DefaultCost
impl Add for DefaultCost
Source§impl Clone for DefaultCost
impl Clone for DefaultCost
Source§fn clone(&self) -> DefaultCost
fn clone(&self) -> DefaultCost
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DefaultCost
impl Debug for DefaultCost
Source§impl Ord for DefaultCost
impl Ord for DefaultCost
Source§impl PartialEq for DefaultCost
impl PartialEq for DefaultCost
Source§impl PartialOrd for DefaultCost
impl PartialOrd for DefaultCost
impl Copy for DefaultCost
impl Cost for DefaultCost
impl Eq for DefaultCost
impl StructuralPartialEq for DefaultCost
Auto Trait Implementations§
impl Freeze for DefaultCost
impl RefUnwindSafe for DefaultCost
impl Send for DefaultCost
impl Sync for DefaultCost
impl Unpin for DefaultCost
impl UnwindSafe for DefaultCost
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)