pub struct ProjectionMapper {
pub fields: Vec<FieldMapping>,
pub typename: Option<String>,
}Expand description
Projection mapper - maps JSONB fields to GraphQL selection set.
Fields§
§fields: Vec<FieldMapping>Fields to project (with optional aliases).
typename: Option<String>Optional __typename value to add to each object.
Implementations§
Source§impl ProjectionMapper
impl ProjectionMapper
Sourcepub fn new(fields: Vec<String>) -> Self
pub fn new(fields: Vec<String>) -> Self
Create new projection mapper from field names (no aliases).
Sourcepub fn with_mappings(fields: Vec<FieldMapping>) -> Self
pub fn with_mappings(fields: Vec<FieldMapping>) -> Self
Create new projection mapper with field mappings (supports aliases).
Sourcepub fn with_typename(self, typename: impl Into<String>) -> Self
pub fn with_typename(self, typename: impl Into<String>) -> Self
Set __typename to include in projected objects.
Trait Implementations§
Source§impl Clone for ProjectionMapper
impl Clone for ProjectionMapper
Source§fn clone(&self) -> ProjectionMapper
fn clone(&self) -> ProjectionMapper
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ProjectionMapper
impl RefUnwindSafe for ProjectionMapper
impl Send for ProjectionMapper
impl Sync for ProjectionMapper
impl Unpin for ProjectionMapper
impl UnsafeUnpin for ProjectionMapper
impl UnwindSafe for ProjectionMapper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more