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§
source§impl 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
.
source§impl 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§
source§impl<'de> Deserialize<'de> for Feature
impl<'de> Deserialize<'de> for Feature
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>,
source§impl<__S> GraphQLObjectType<__S> for Featurewhere
__S: ScalarValue,
impl<__S> GraphQLObjectType<__S> for Featurewhere __S: ScalarValue,
source§impl<__S> GraphQLType<__S> for Featurewhere
__S: ScalarValue,
impl<__S> GraphQLType<__S> for Featurewhere __S: ScalarValue,
source§impl<__S> GraphQLValue<__S> for Featurewhere
__S: ScalarValue,
impl<__S> GraphQLValue<__S> for Featurewhere __S: ScalarValue,
§type Context = ()
type Context = ()
GraphQLValue
. Read more§type TypeInfo = ()
type TypeInfo = ()
GraphQLValue
. Read moresource§fn 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 moresource§fn 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 moresource§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>>
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 moresource§impl<__S> GraphQLValueAsync<__S> for Featurewhere
__S: ScalarValue + Send + Sync,
Self: Sync,
impl<__S> GraphQLValueAsync<__S> for Featurewhere __S: ScalarValue + Send + Sync, Self: Sync,
source§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,
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 moresource§fn resolve_into_type_async<'a>(
&'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>( &'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 moresource§impl<__S> IsOutputType<__S> for Featurewhere
__S: ScalarValue,
impl<__S> IsOutputType<__S> for Featurewhere __S: ScalarValue,
source§impl Ord for Feature
impl Ord for Feature
source§impl PartialEq<Feature> for Feature
impl PartialEq<Feature> for Feature
source§impl PartialOrd<Feature> for Feature
impl PartialOrd<Feature> for Feature
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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§
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
source§impl<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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.