[][src]Enum genco::csharp::Csharp

pub enum Csharp<'el> {
    Simple {
        name: &'static str,
        alias: &'static str,
    },
    Array(Box<Csharp<'el>>),
    Struct(Type<'el>),
    Void,
    Class(Type<'el>),
    Enum(Type<'el>),
    Local {
        name: Cons<'el>,
    },
    Optional(Box<Csharp<'el>>),
}

Csharp token specialization.

Variants

Simple

Simple type.

Fields of Simple

name: &'static str

The name of the simple type.

alias: &'static str

Their .NET aliases.

Array(Box<Csharp<'el>>)

An array of some type.

Struct(Type<'el>)

A struct of some type.

Void

The special void type.

Class(Type<'el>)

A class, with or without arguments, using from somewhere.

Enum(Type<'el>)

An enum of some type.

Local

A local name with no specific qualification.

Fields of Local

name: Cons<'el>

Name of class.

Optional(Box<Csharp<'el>>)

Optional type.

Implementations

impl<'el> Csharp<'el>[src]

pub fn path<P: Into<Cons<'el>>>(&self, part: P) -> Csharp<'el>[src]

Extend the type with a nested path.

This discards any arguments associated with it.

pub fn with_arguments(&self, arguments: Vec<Csharp<'el>>) -> Csharp<'el>[src]

Add arguments to the given variable.

Only applies to classes, any other will return the same value.

pub fn into_struct(self) -> Csharp<'el>[src]

Convert this type into a struct.

pub fn into_enum(self) -> Csharp<'el>[src]

Convert this type into an enum.

pub fn qualified(self) -> Csharp<'el>[src]

Make this type into a qualified type that is always used with a namespace.

pub fn equals(&self, other: &Csharp<'el>) -> bool[src]

Compare if two types are equal.

pub fn name(&self) -> Cons<'el>[src]

Get the name of the type.

pub fn namespace(&self) -> Option<Cons<'el>>[src]

Get the name of the type.

pub fn arguments(&self) -> Option<&[Csharp<'el>]>[src]

Get the arguments

pub fn as_value(&self) -> Csharp<'el>[src]

Get the value type (strips optionality).

pub fn is_optional(&self) -> bool[src]

Check if type is optional.

pub fn is_nullable(&self) -> bool[src]

Check if type is nullable.

pub fn is_simple(&self) -> bool[src]

Check if variable is simple.

pub fn is_array(&self) -> bool[src]

Check if type is array.

pub fn is_struct(&self) -> bool[src]

Check if type is struct.

pub fn is_enum(&self) -> bool[src]

Check if type is an enum.

pub fn as_optional(&self) -> Option<&Csharp<'el>>[src]

Get type as optional.

Trait Implementations

impl<'el> Clone for Csharp<'el>[src]

impl<'el> Custom for Csharp<'el>[src]

type Config = Config<'el>

Configuration associated with building a formatting element.

impl<'el> Debug for Csharp<'el>[src]

impl<'el> Eq for Csharp<'el>[src]

impl<'el> From<&'el Csharp<'el>> for Tokens<'el, Csharp<'el>>[src]

impl<'el> From<Csharp<'el>> for Tokens<'el, Csharp<'el>>[src]

impl<'el> Hash for Csharp<'el>[src]

impl<'el> IntoTokens<'el, Csharp<'el>> for Argument<'el>[src]

impl<'el> IntoTokens<'el, Csharp<'el>> for Class<'el>[src]

impl<'el> IntoTokens<'el, Csharp<'el>> for (Cons<'el>, Constructor<'el>)[src]

impl<'el> IntoTokens<'el, Csharp<'el>> for Enum<'el>[src]

impl<'el> IntoTokens<'el, Csharp<'el>> for Field<'el>[src]

impl<'el> IntoTokens<'el, Csharp<'el>> for Interface<'el>[src]

impl<'el> IntoTokens<'el, Csharp<'el>> for Method<'el>[src]

impl<'el> IntoTokens<'el, Csharp<'el>> for BlockComment<'el>[src]

impl<'el> Ord for Csharp<'el>[src]

impl<'el> PartialEq<Csharp<'el>> for Csharp<'el>[src]

impl<'el> PartialOrd<Csharp<'el>> for Csharp<'el>[src]

impl<'el> StructuralEq for Csharp<'el>[src]

impl<'el> StructuralPartialEq for Csharp<'el>[src]

Auto Trait Implementations

impl<'el> !RefUnwindSafe for Csharp<'el>

impl<'el> !Send for Csharp<'el>

impl<'el> !Sync for Csharp<'el>

impl<'el> Unpin for Csharp<'el>

impl<'el> UnwindSafe for Csharp<'el>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.