pub struct SearchDepth(/* private fields */);Expand description
How many directory levels the recursive project-marker walk descends:
at most MAX_HEURISTICS_DEPTH.
Deserializes from a TOML integer and rejects an out-of-range value at load time.
§Examples
use mcpls_core::config::SearchDepth;
assert_eq!(SearchDepth::default().get(), 10);
assert_eq!(SearchDepth::new(64).unwrap().get(), 64);
assert!(SearchDepth::new(65).is_err());Implementations§
Source§impl SearchDepth
impl SearchDepth
Sourcepub const fn new(depth: usize) -> Result<Self, InvalidSearchDepth>
pub const fn new(depth: usize) -> Result<Self, InvalidSearchDepth>
Sourcepub const fn get(self) -> usize
pub const fn get(self) -> usize
The wrapped depth, at most MAX_HEURISTICS_DEPTH.
Source§impl SearchDepth
impl SearchDepth
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
The built-in default, DEFAULT_HEURISTICS_MAX_DEPTH.
Trait Implementations§
Source§impl Clone for SearchDepth
impl Clone for SearchDepth
impl Copy for SearchDepth
Source§impl Debug for SearchDepth
impl Debug for SearchDepth
Source§impl Default for SearchDepth
impl Default for SearchDepth
Source§impl<'de> Deserialize<'de> for SearchDepth
impl<'de> Deserialize<'de> for SearchDepth
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
impl Eq for SearchDepth
Source§impl From<SearchDepth> for usize
impl From<SearchDepth> for usize
Source§fn from(value: SearchDepth) -> Self
fn from(value: SearchDepth) -> Self
Converts to this type from the input type.
Source§impl Hash for SearchDepth
impl Hash for SearchDepth
Source§impl PartialEq for SearchDepth
impl PartialEq for SearchDepth
Source§impl Serialize for SearchDepth
impl Serialize for SearchDepth
impl StructuralPartialEq for SearchDepth
Auto Trait Implementations§
impl Freeze for SearchDepth
impl RefUnwindSafe for SearchDepth
impl Send for SearchDepth
impl Sync for SearchDepth
impl Unpin for SearchDepth
impl UnsafeUnpin for SearchDepth
impl UnwindSafe for SearchDepth
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.