pub struct Pattern {
pub prefix: String,
pub suffix: String,
pub contains: String,
pub prefix_match: String,
pub suffix_match: String,
pub contains_match: String,
pub ignore_case: bool,
pub fixed_prefix_len: usize,
}Fields§
§prefix: String§suffix: String§contains: String§prefix_match: String§suffix_match: String§contains_match: String§ignore_case: bool§fixed_prefix_len: usizeLeading chars of prefix every address has anyway (0x, kaspa:, cosmos1…);
they cost nothing to match, so difficulty counts skip them.
Implementations§
Source§impl Pattern
impl Pattern
pub fn has_prefix(&self) -> bool
pub fn has_suffix(&self) -> bool
pub fn has_contains(&self) -> bool
pub fn description(&self) -> String
pub fn case_mode(&self) -> &'static str
Sourcepub fn effective_literal_chars(&self) -> usize
pub fn effective_literal_chars(&self) -> usize
Literal character count used for difficulty estimates (* wildcards ignored).
Sourcepub fn user_prefix(&self) -> &str
pub fn user_prefix(&self) -> &str
The part of prefix the user actually asked for (chain-forced start removed).
Sourcepub fn set_fixed_prefix(&mut self, fixed: &str)
pub fn set_fixed_prefix(&mut self, fixed: &str)
Record fixed as the chain-forced start of prefix (no-op if it isn’t there).
Trait Implementations§
Auto Trait Implementations§
impl Forget for Pattern
impl Freeze for Pattern
impl Move for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnsafeUnpin for Pattern
impl UnwindSafe for Pattern
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<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