pub struct BrSpaces(/* private fields */);Expand description
Number of trailing spaces for Markdown line breaks (≥2)
In Markdown, a line break requires at least 2 trailing spaces. Values of 0 or 1 don’t create line breaks and would silently fail. This type enforces that constraint at deserialization time, preventing broken line break configurations.
CommonMark specification requires exactly 2 spaces, but some flavors allow more.
Implementations§
Source§impl BrSpaces
impl BrSpaces
Sourcepub fn new(value: usize) -> Result<Self, BrSpacesError>
pub fn new(value: usize) -> Result<Self, BrSpacesError>
Create a new BrSpaces, validating it’s at least 2.
§Errors
Returns BrSpacesError if the value is less than 2.
Sourcepub const fn from_const(value: usize) -> Self
pub const fn from_const(value: usize) -> Self
Convert from a default value (for use in config defaults).
§Panics
Panics if the value is less than 2. This is intended for const defaults only.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BrSpaces
impl<'de> Deserialize<'de> for BrSpaces
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 Ord for BrSpaces
impl Ord for BrSpaces
Source§impl PartialOrd for BrSpaces
impl PartialOrd for BrSpaces
impl Copy for BrSpaces
impl Eq for BrSpaces
impl StructuralPartialEq for BrSpaces
Auto Trait Implementations§
impl Freeze for BrSpaces
impl RefUnwindSafe for BrSpaces
impl Send for BrSpaces
impl Sync for BrSpaces
impl Unpin for BrSpaces
impl UnwindSafe for BrSpaces
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