pub struct IndentSize(/* private fields */);Expand description
Indentation size (1-8 spaces)
Enforces reasonable indentation bounds. While Markdown technically allows any indentation, values outside 1-8 are either mistakes or impractical. Common values are 2 (default) and 4.
Implementations§
Source§impl IndentSize
impl IndentSize
Sourcepub fn new(value: u8) -> Result<Self, IndentSizeError>
pub fn new(value: u8) -> Result<Self, IndentSizeError>
Create a new IndentSize, validating it’s in range 1-8.
§Errors
Returns IndentSizeError if the value is not between 1 and 8 inclusive.
Sourcepub const fn from_const(value: u8) -> Self
pub const fn from_const(value: u8) -> Self
Convert from a default value (for use in config defaults).
§Panics
Panics if the value is not in range 1-8. This is intended for const defaults only.
Trait Implementations§
Source§impl Clone for IndentSize
impl Clone for IndentSize
Source§fn clone(&self) -> IndentSize
fn clone(&self) -> IndentSize
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 IndentSize
impl Debug for IndentSize
Source§impl Default for IndentSize
impl Default for IndentSize
Source§impl<'de> Deserialize<'de> for IndentSize
impl<'de> Deserialize<'de> for IndentSize
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<IndentSize> for u8
impl From<IndentSize> for u8
Source§fn from(val: IndentSize) -> Self
fn from(val: IndentSize) -> Self
Converts to this type from the input type.
Source§impl From<IndentSize> for usize
impl From<IndentSize> for usize
Source§fn from(val: IndentSize) -> Self
fn from(val: IndentSize) -> Self
Converts to this type from the input type.
Source§impl Hash for IndentSize
impl Hash for IndentSize
Source§impl Ord for IndentSize
impl Ord for IndentSize
Source§fn cmp(&self, other: &IndentSize) -> Ordering
fn cmp(&self, other: &IndentSize) -> 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 IndentSize
impl PartialEq for IndentSize
Source§impl PartialOrd for IndentSize
impl PartialOrd for IndentSize
Source§impl Serialize for IndentSize
impl Serialize for IndentSize
impl Copy for IndentSize
impl Eq for IndentSize
impl StructuralPartialEq for IndentSize
Auto Trait Implementations§
impl Freeze for IndentSize
impl RefUnwindSafe for IndentSize
impl Send for IndentSize
impl Sync for IndentSize
impl Unpin for IndentSize
impl UnwindSafe for IndentSize
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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