pub struct GrammarRoundTrip<'a> {
pub import: GrammarImportFn<'a>,
pub emit: GrammarEmitFn<'a>,
pub marker: &'a str,
pub accepts: &'a [String],
pub rejects: &'a [String],
}Expand description
The importer/emitter pair under test and the independent samples.
Fields§
§import: GrammarImportFn<'a>Importer of the notation.
emit: GrammarEmitFn<'a>Emitter of the same notation.
marker: &'a strLiteral alternative added to the start rule before export.
accepts: &'a [String]Texts the grammar must accept.
rejects: &'a [String]Texts the grammar must reject.
Implementations§
Source§impl<'a> GrammarRoundTrip<'a>
impl<'a> GrammarRoundTrip<'a>
Sourcepub const fn new(import: GrammarImportFn<'a>, emit: GrammarEmitFn<'a>) -> Self
pub const fn new(import: GrammarImportFn<'a>, emit: GrammarEmitFn<'a>) -> Self
Builds a round trip through import and emit with the default
marker and no samples.
Sourcepub const fn with_samples(
self,
accepts: &'a [String],
rejects: &'a [String],
) -> Self
pub const fn with_samples( self, accepts: &'a [String], rejects: &'a [String], ) -> Self
Returns this round trip with independent accept and reject samples.
Trait Implementations§
Source§impl<'a> Clone for GrammarRoundTrip<'a>
impl<'a> Clone for GrammarRoundTrip<'a>
Source§fn clone(&self) -> GrammarRoundTrip<'a>
fn clone(&self) -> GrammarRoundTrip<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for GrammarRoundTrip<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for GrammarRoundTrip<'a>
impl<'a> !Send for GrammarRoundTrip<'a>
impl<'a> !Sync for GrammarRoundTrip<'a>
impl<'a> !UnwindSafe for GrammarRoundTrip<'a>
impl<'a> Freeze for GrammarRoundTrip<'a>
impl<'a> Unpin for GrammarRoundTrip<'a>
impl<'a> UnsafeUnpin for GrammarRoundTrip<'a>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.