pub struct Feature {
pub keyword: String,
pub name: String,
pub description: Option<String>,
pub background: Option<Background>,
pub scenarios: Vec<Scenario>,
pub rules: Vec<Rule>,
pub tags: Vec<String>,
pub span: Span,
pub position: LineCol,
pub path: Option<PathBuf>,
}
Expand description
A feature
Fields
keyword: String
The raw keyword used in the original source.
name: String
The name of the feature.
description: Option<String>
The description of the feature, if found.
background: Option<Background>
The background of the feature, if found.
scenarios: Vec<Scenario>
The scenarios for the feature.
rules: Vec<Rule>
The rules for the feature.
The tags for the feature if provided.
span: Span
The (start, end)
offset the feature directive was found in the .feature file.
position: LineCol
The (line, col)
position the feature directive was found in the .feature file.
path: Option<PathBuf>
The path supplied for the parsed Feature
, if known.
Implementations
sourceimpl Feature
impl Feature
sourcepub fn builder() -> FeatureBuilder<((), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> FeatureBuilder<((), (), (), (), (), (), (), (), (), ())>
Create a builder for building Feature
.
On the builder, call .keyword(...)
, .name(...)
, .description(...)
(optional), .background(...)
(optional), .scenarios(...)
(optional), .rules(...)
(optional), .tags(...)
(optional), .span(...)
(optional), .position(...)
(optional), .path(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of Feature
.
sourceimpl Feature
impl Feature
pub fn parse_path<P: AsRef<Path>>(
path: P,
env: GherkinEnv
) -> Result<Feature, ParseFileError>
pub fn parse<S: AsRef<str>>(
input: S,
env: GherkinEnv
) -> Result<Feature, ParseError>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Feature
impl<'de> Deserialize<'de> for Feature
sourcefn 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>,
sourceimpl<__S> GraphQLObjectType<__S> for Featurewhere
__S: ScalarValue,
impl<__S> GraphQLObjectType<__S> for Featurewhere
__S: ScalarValue,
sourceimpl<__S> GraphQLType<__S> for Featurewhere
__S: ScalarValue,
impl<__S> GraphQLType<__S> for Featurewhere
__S: ScalarValue,
sourceimpl<__S> GraphQLValue<__S> for Featurewhere
__S: ScalarValue,
impl<__S> GraphQLValue<__S> for Featurewhere
__S: ScalarValue,
type Context = ()
type Context = ()
GraphQLValue
. Read moretype TypeInfo = ()
type TypeInfo = ()
GraphQLValue
. Read moresourcefn resolve_field(
&self,
_info: &(),
field: &str,
args: &Arguments<'_, __S>,
executor: &Executor<'_, '_, Self::Context, __S>
) -> ExecutionResult<__S>
fn resolve_field(
&self,
_info: &(),
field: &str,
args: &Arguments<'_, __S>,
executor: &Executor<'_, '_, Self::Context, __S>
) -> ExecutionResult<__S>
GraphQLValue
. Read moresourcefn concrete_type_name(&self, _: &Self::Context, _: &Self::TypeInfo) -> String
fn concrete_type_name(&self, _: &Self::Context, _: &Self::TypeInfo) -> String
GraphQLType
name for this GraphQLValue
being an interface,
an union or an object. Read moresourcefn resolve_into_type(
&self,
info: &Self::TypeInfo,
type_name: &str,
selection_set: Option<&[Selection<'_, S>]>,
executor: &Executor<'_, '_, Self::Context, S>
) -> Result<Value<S>, FieldError<S>>
fn resolve_into_type(
&self,
info: &Self::TypeInfo,
type_name: &str,
selection_set: Option<&[Selection<'_, S>]>,
executor: &Executor<'_, '_, Self::Context, S>
) -> Result<Value<S>, FieldError<S>>
GraphQLValue
(being an interface or an union) into a concrete
downstream object type. Read moresourceimpl<__S> GraphQLValueAsync<__S> for Featurewhere
__S: ScalarValue,
__S: Send + Sync,
Self: Sync,
impl<__S> GraphQLValueAsync<__S> for Featurewhere
__S: ScalarValue,
__S: Send + Sync,
Self: Sync,
sourcefn resolve_field_async<'b>(
&'b self,
info: &'b Self::TypeInfo,
field: &'b str,
args: &'b Arguments<'_, __S>,
executor: &'b Executor<'_, '_, Self::Context, __S>
) -> BoxFuture<'b, ExecutionResult<__S>>where
__S: Send + Sync,
fn resolve_field_async<'b>(
&'b self,
info: &'b Self::TypeInfo,
field: &'b str,
args: &'b Arguments<'_, __S>,
executor: &'b Executor<'_, '_, Self::Context, __S>
) -> BoxFuture<'b, ExecutionResult<__S>>where
__S: Send + Sync,
GraphQLValueAsync
. Read moresourcefn resolve_into_type_async(
&'a self,
info: &'a Self::TypeInfo,
type_name: &str,
selection_set: Option<&'a [Selection<'a, S>]>,
executor: &'a Executor<'a, 'a, Self::Context, S>
) -> Pin<Box<dyn Future<Output = Result<Value<S>, FieldError<S>>> + Send + 'a, Global>>
fn resolve_into_type_async(
&'a self,
info: &'a Self::TypeInfo,
type_name: &str,
selection_set: Option<&'a [Selection<'a, S>]>,
executor: &'a Executor<'a, 'a, Self::Context, S>
) -> Pin<Box<dyn Future<Output = Result<Value<S>, FieldError<S>>> + Send + 'a, Global>>
GraphQLValueAsync
(being an interface or an union) into a
concrete downstream object type. Read moresourceimpl<__S> IsOutputType<__S> for Featurewhere
__S: ScalarValue,
impl<__S> IsOutputType<__S> for Featurewhere
__S: ScalarValue,
sourceimpl Ord for Feature
impl Ord for Feature
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialOrd<Feature> for Feature
impl PartialOrd<Feature> for Feature
sourcefn partial_cmp(&self, other: &Feature) -> Option<Ordering>
fn partial_cmp(&self, other: &Feature) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Feature
impl StructuralEq for Feature
impl StructuralPartialEq for Feature
Auto Trait Implementations
impl RefUnwindSafe for Feature
impl Send for Feature
impl Sync for Feature
impl Unpin for Feature
impl UnwindSafe for Feature
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.