pub enum CfgFeature {
Single(CargoFeature),
AnyOf(BTreeSet<CargoFeature>),
AllOf(BTreeSet<CargoFeature>),
OwnAndUsedBy {
own: CargoFeature,
used_by: BTreeSet<CargoFeature>,
},
}Expand description
Generates a #[cfg(...)] attribute for conditional compilation.
Variants§
Single(CargoFeature)
A single feature = "name" predicate.
AnyOf(BTreeSet<CargoFeature>)
A compound any(feature = "a", feature = "b", ...) predicate.
AllOf(BTreeSet<CargoFeature>)
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 CfgFeature
impl CfgFeature
Sourcepub fn for_schema_type(view: &SchemaIrTypeView<'_>) -> Option<Self>
pub fn for_schema_type(view: &SchemaIrTypeView<'_>) -> 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(view: &InlineIrTypeView<'_>) -> Option<Self>
pub fn for_inline_type(view: &InlineIrTypeView<'_>) -> Option<Self>
Builds a #[cfg(...)] attribute for an inline type.
Sourcepub fn for_operation(view: &IrOperationView<'_>) -> Option<Self>
pub fn for_operation(view: &IrOperationView<'_>) -> Option<Self>
Builds a #[cfg(...)] attribute for a client method.
Sourcepub fn for_resource_module(feature: &CargoFeature) -> Option<Self>
pub fn for_resource_module(feature: &CargoFeature) -> Option<Self>
Builds a #[cfg(...)] attribute for a resource mod declaration in a
CodegenClientModule.
Trait Implementations§
Source§impl Clone for CfgFeature
impl Clone for CfgFeature
Source§fn clone(&self) -> CfgFeature
fn clone(&self) -> CfgFeature
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CfgFeature
impl Debug for CfgFeature
Source§impl PartialEq for CfgFeature
impl PartialEq for CfgFeature
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,
impl Eq for CfgFeature
impl StructuralPartialEq for CfgFeature
Auto Trait Implementations§
impl Freeze for CfgFeature
impl RefUnwindSafe for CfgFeature
impl Send for CfgFeature
impl Sync for CfgFeature
impl Unpin for CfgFeature
impl UnwindSafe for CfgFeature
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
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 moreSource§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.