Struct snarkvm_wasm::algorithms::field::Sanitizer
pub struct Sanitizer;
Implementations
impl Sanitizer
impl Sanitizer
pub fn parse(string: &str) -> Result<(&str, &str), Err<VerboseError<&str>>>
pub fn parse(string: &str) -> Result<(&str, &str), Err<VerboseError<&str>>>
Removes all leading whitespaces and comments from the given input, returning the sanitized input.
pub fn parse_whitespaces(
string: &str
) -> Result<(&str, &str), Err<VerboseError<&str>>>
pub fn parse_whitespaces(
string: &str
) -> Result<(&str, &str), Err<VerboseError<&str>>>
Removes leading whitespaces from the given input.
pub fn parse_comments(
string: &str
) -> Result<(&str, &str), Err<VerboseError<&str>>>
pub fn parse_comments(
string: &str
) -> Result<(&str, &str), Err<VerboseError<&str>>>
Removes multiple leading comments from the given input.
pub fn parse_comment(
string: &str
) -> Result<(&str, &str), Err<VerboseError<&str>>>
pub fn parse_comment(
string: &str
) -> Result<(&str, &str), Err<VerboseError<&str>>>
Removes the first leading comment from the given input.
pub fn parse_safe_char(
string: &str
) -> Result<(&str, char), Err<VerboseError<&str>>>
pub fn parse_safe_char(
string: &str
) -> Result<(&str, char), Err<VerboseError<&str>>>
Parse a safe character (in the sense explained in [string_parser::is_char_supported]). Returns an error if no character is found or a non-safe character is found. The character is returned, along with the remaining input.
This is used for otherwise unconstrained characters in (line and block) comments and in string literals.
Note also that the nom
documentation for anychar
says that
it matches one byte as a character.
However, simple experiments show that it matches a Unicode character,
e.g. attempting to parse "\u{4141}"
yields one CJK character and exhausts the input,
as opposed to returning A
and leaving another A
in the input.
Auto Trait Implementations
impl RefUnwindSafe for Sanitizer
impl Send for Sanitizer
impl Sync for Sanitizer
impl Unpin for Sanitizer
impl UnwindSafe for Sanitizer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;