mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
feat(docs): Traits now show up as part of lib
Previously, they were in an extra, oddly named crate. Now we just make it a part of our generated codebase. That way, traits, and common code, shows up as part of the library. Fair enough. This also means that the types ar not reusable. Maybe a mixed-mode can be used if that is desired.
This commit is contained in:
19
src/rust/cmn.rs
Normal file
19
src/rust/cmn.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use std::marker::MarkerTrait;
|
||||
|
||||
/// Identifies types which can be inserted and deleted.
|
||||
/// Types with this trait are most commonly used by clients of this API.
|
||||
pub trait Resource: MarkerTrait {}
|
||||
|
||||
/// Identifies types which are used in API responses.
|
||||
pub trait ResponseResult: MarkerTrait {}
|
||||
|
||||
/// Identifies types which are used in API requests.
|
||||
pub trait RequestResult: MarkerTrait {}
|
||||
|
||||
/// Identifies types which are only used as part of other types, which
|
||||
/// usually are carrying the `Resource` trait.
|
||||
pub trait Part: MarkerTrait {}
|
||||
|
||||
/// Identifies types which are only used by other types internally.
|
||||
/// They have no special meaning, this trait just marks them for completeness.
|
||||
pub trait NestedType: MarkerTrait {}
|
||||
@@ -1,27 +1,11 @@
|
||||
#![feature(core)]
|
||||
//! library with code shared by all generated implementations
|
||||
extern crate hyper;
|
||||
extern crate "rustc-serialize" as rustc_serialize;
|
||||
extern crate "yup-oauth2" as oauth2;
|
||||
|
||||
use std::marker::MarkerTrait;
|
||||
|
||||
/// Identifies types which can be inserted and deleted.
|
||||
/// Types with this trait are most commonly used by clients of this API.
|
||||
pub trait Resource: MarkerTrait {}
|
||||
|
||||
/// Identifies types which are used in API responses.
|
||||
pub trait ResponseResult: MarkerTrait {}
|
||||
|
||||
/// Identifies types which are used in API requests.
|
||||
pub trait RequestResult: MarkerTrait {}
|
||||
|
||||
/// Identifies types which are only used as part of other types, which
|
||||
/// usually are carrying the `Resource` trait.
|
||||
pub trait Part: MarkerTrait {}
|
||||
|
||||
/// Identifies types which are only used by other types internally.
|
||||
/// They have no special meaning, this trait just marks them for completeness.
|
||||
pub trait NestedType: MarkerTrait {}
|
||||
// just pull it in the check if it compiles
|
||||
mod cmn;
|
||||
|
||||
/// This module is for testing only, its code is used in mako templates
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user