pub struct Projection<T>where
T: SqlEntity,{ /* private fields */ }Expand description
A Projection defines what is output from a query in order to hydrate a [SQLEntity]
Implementations§
Source§impl<T> Projection<T>where
T: SqlEntity,
impl<T> Projection<T>where
T: SqlEntity,
Sourcepub fn new(alias: &str) -> Self
pub fn new(alias: &str) -> Self
Create a new projection with an alias. The alias is used to prefix the field names. If the alias is empty, the projection will not be aliased.
Sourcepub fn set_definition(self, name: &str, definition: &str) -> Self
pub fn set_definition(self, name: &str, definition: &str) -> Self
Replace a field definition. It panics if the field is not declared.
Sourcepub fn get_fields(&self) -> Vec<String>
pub fn get_fields(&self) -> Vec<String>
Return the field names list.
Sourcepub fn get_structure(&self) -> &Structure
pub fn get_structure(&self) -> &Structure
Return the underlying structure.
Trait Implementations§
Source§impl<T> Clone for Projection<T>
impl<T> Clone for Projection<T>
Source§fn clone(&self) -> Projection<T>
fn clone(&self) -> Projection<T>
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 moreSource§impl<T> Debug for Projection<T>
impl<T> Debug for Projection<T>
Source§impl<T> Default for Projection<T>where
T: SqlEntity,
impl<T> Default for Projection<T>where
T: SqlEntity,
Auto Trait Implementations§
impl<T> Freeze for Projection<T>
impl<T> RefUnwindSafe for Projection<T>where
T: RefUnwindSafe,
impl<T> Send for Projection<T>where
T: Send,
impl<T> Sync for Projection<T>where
T: Sync,
impl<T> Unpin for Projection<T>where
T: Unpin,
impl<T> UnsafeUnpin for Projection<T>
impl<T> UnwindSafe for Projection<T>where
T: UnwindSafe,
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