[][src]Enum genco::csharp::Imported

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

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<Imported>)

An array of some type.

Struct(Type)

A struct of some type.

Void

The special void type.

Class(Type)

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

Enum(Type)

An enum of some type.

Local

A local name with no specific qualification.

Fields of Local

name: Cons<'static>

Name of class.

Optional(Box<Imported>)

Optional type.

Implementations

impl Imported[src]

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

Extend the type with a nested path.

This discards any arguments associated with it.

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

Add arguments to the given variable.

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

pub fn into_struct(self) -> Imported[src]

Convert this type into a struct.

pub fn into_enum(self) -> Imported[src]

Convert this type into an enum.

pub fn qualified(self) -> Imported[src]

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

pub fn equals(&self, other: &Imported) -> bool[src]

Compare if two types are equal.

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

Get the name of the type.

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

Get the name of the type.

pub fn arguments(&self) -> Option<&[Imported]>[src]

Get the arguments

pub fn as_value(&self) -> Imported[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<&Imported>[src]

Get type as optional.

Trait Implementations

impl Clone for Imported[src]

impl Debug for Imported[src]

impl Eq for Imported[src]

impl<'el> FormatTokens<'el, Csharp> for Imported[src]

impl<'el> FormatTokens<'el, Csharp> for &'el Imported[src]

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

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

impl Hash for Imported[src]

impl LangItem<Csharp> for Imported[src]

impl Ord for Imported[src]

impl PartialEq<Imported> for Imported[src]

impl PartialOrd<Imported> for Imported[src]

impl StructuralEq for Imported[src]

impl StructuralPartialEq for Imported[src]

Auto Trait Implementations

impl !RefUnwindSafe for Imported

impl !Send for Imported

impl !Sync for Imported

impl Unpin for Imported

impl UnwindSafe for Imported

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.