Struct apollo_encoder::UnionDef [−][src]
pub struct UnionDef { /* fields omitted */ }Expand description
UnionDefs are an abstract type where no common fields are declared.
UnionDefTypeDefinition: Description? union Name Directives? UnionDefMemberTypes?
Detailed documentation can be found in GraphQL spec.
Example
use apollo_encoder::{UnionDef};
let mut union_ = UnionDef::new("Pet".to_string());
union_.member("Cat".to_string());
union_.member("Dog".to_string());
assert_eq!(
union_.to_string(),
r#"union Pet = Cat | Dog
"#
);Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for UnionDef
impl UnwindSafe for UnionDef
Blanket Implementations
Mutably borrows from an owned value. Read more