[][src]Struct paperclip::v2::codegen::object::ApiObject

pub struct ApiObject {
    pub name: String,
    pub description: Option<String>,
    pub path: String,
    pub inner: ObjectContainer,
    pub paths: BTreeMap<String, PathOps>,
}

Represents a (simplified) Rust struct or enum.

Fields

name: String

Name of the struct (camel-cased).

description: Option<String>

Description for this object (if any), to be used for docs.

path: String

Path to this object from (generated) root module.

inner: ObjectContainer

Fields/variants based on whether this is a struct/enum.

paths: BTreeMap<String, PathOps>

Paths with operations which address this object.

Methods

impl ApiObject[src]

pub fn impl_repr<'a>(
    &'a self,
    helper_module_prefix: &'a str
) -> ApiObjectImpl<'a>
[src]

Returns a struct representing the impl for this object. This also holds the builders generated for this object.

Each builder is bound to an operation in a path. If the object is not bound to any operation, then the builder only keeps track of the fields for building the actual object.

impl ApiObject[src]

pub fn fields_mut(&mut self) -> &mut Vec<ObjectField>[src]

Get a mutable reference to the struct fields. Panics if this is not a struct.

Important traits for &'_ mut [u8]
pub fn fields(&self) -> &[ObjectField][src]

Get a reference to the struct fields. Panics if this is not a struct.

pub fn variants_mut(&mut self) -> &mut Vec<ObjectVariant>[src]

Get a mutable reference to the enum variants. Panics if this is not an enum.

Important traits for &'_ mut [u8]
pub fn variants(&self) -> &[ObjectVariant][src]

Get a reference to the enum variants. Panics if this is not an enum.

impl ApiObject[src]

pub fn with_name<S>(name: S) -> Self where
    S: Into<String>, 
[src]

Create an object with the given name.

Trait Implementations

impl Clone for ApiObject[src]

impl Debug for ApiObject[src]

impl Default for ApiObject[src]

impl Display for ApiObject[src]

Auto Trait Implementations

impl RefUnwindSafe for ApiObject

impl Send for ApiObject

impl Sync for ApiObject

impl Unpin for ApiObject

impl UnwindSafe for ApiObject

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> ToString for T where
    T: Display + ?Sized
[src]

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.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,