pub enum CfgFeature<'a> {
Single(UniqueIdent<'a>),
AnyOf(BTreeSet<UniqueIdent<'a>>),
AllOf(BTreeSet<UniqueIdent<'a>>),
OwnAndUsedBy {
own: UniqueIdent<'a>,
used_by: BTreeSet<UniqueIdent<'a>>,
},
}Expand description
Generates a #[cfg(...)] attribute for conditional compilation.
Variants§
Single(UniqueIdent<'a>)
A single feature = "name" predicate.
AnyOf(BTreeSet<UniqueIdent<'a>>)
A compound any(feature = "a", feature = "b", ...) predicate.
AllOf(BTreeSet<UniqueIdent<'a>>)
A compound all(feature = "a", feature = "b", ...) predicate.
OwnAndUsedBy
A compound all(feature = "own", any(feature = "a", ...)) predicate,
used for schema types that both specify an x-resourceId, and are
used by operations that specify an x-resource-name.
Implementations§
Source§impl<'a> CfgFeature<'a>
impl<'a> CfgFeature<'a>
Sourcepub fn for_schema_type(
graph: &CodegenGraph<'a>,
view: &SchemaTypeView<'_, 'a>,
) -> Option<Self>
pub fn for_schema_type( graph: &CodegenGraph<'a>, view: &SchemaTypeView<'_, 'a>, ) -> Option<Self>
Builds a #[cfg(...)] attribute for a schema type, based on
its own resource, and the resources of the operations that use it.
Sourcepub fn for_inline_type(
graph: &CodegenGraph<'a>,
view: &InlineTypeView<'_, 'a>,
) -> Option<Self>
pub fn for_inline_type( graph: &CodegenGraph<'a>, view: &InlineTypeView<'_, 'a>, ) -> Option<Self>
Builds a #[cfg(...)] attribute for an inline type.
Sourcepub fn for_operation(
graph: &CodegenGraph<'a>,
view: &OperationView<'_, 'a>,
) -> Option<Self>
pub fn for_operation( graph: &CodegenGraph<'a>, view: &OperationView<'_, 'a>, ) -> Option<Self>
Builds a #[cfg(...)] attribute for a client method.
Trait Implementations§
Source§impl<'a> Clone for CfgFeature<'a>
impl<'a> Clone for CfgFeature<'a>
Source§fn clone(&self) -> CfgFeature<'a>
fn clone(&self) -> CfgFeature<'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 moreSource§impl<'a> Debug for CfgFeature<'a>
impl<'a> Debug for CfgFeature<'a>
impl<'a> Eq for CfgFeature<'a>
Source§impl<'a> PartialEq for CfgFeature<'a>
impl<'a> PartialEq for CfgFeature<'a>
Source§fn eq(&self, other: &CfgFeature<'a>) -> bool
fn eq(&self, other: &CfgFeature<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for CfgFeature<'a>
Source§impl ToTokens for CfgFeature<'_>
impl ToTokens for CfgFeature<'_>
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations§
impl<'a> Freeze for CfgFeature<'a>
impl<'a> RefUnwindSafe for CfgFeature<'a>
impl<'a> Send for CfgFeature<'a>
impl<'a> Sync for CfgFeature<'a>
impl<'a> Unpin for CfgFeature<'a>
impl<'a> UnsafeUnpin for CfgFeature<'a>
impl<'a> UnwindSafe for CfgFeature<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.