pub struct CustomAnnotation {
pub name: String,
pub value: String,
pub line: usize,
}Expand description
A custom (non-native) annotation captured verbatim from the SQL source.
Scythe parses its known annotations (@name, @returns, @param, @nullable,
@nonnull, @json, @optional, @group_by, @deprecated) into typed fields.
Any other -- @<name> <value> line is captured here as an opaque triple and
exposed to crate consumers, who can layer their own annotation vocabulary on
top of scythe without coupling scythe to their domain.
Fields§
§name: StringAnnotation name, lowercased, without the leading @ (e.g. http, http_param).
value: StringEverything after the name on the line, trimmed. Empty if the annotation had no value.
line: usize1-based line number within the query SQL, for diagnostics.
Trait Implementations§
Source§impl Clone for CustomAnnotation
impl Clone for CustomAnnotation
Source§fn clone(&self) -> CustomAnnotation
fn clone(&self) -> CustomAnnotation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CustomAnnotation
impl Debug for CustomAnnotation
Source§impl PartialEq for CustomAnnotation
impl PartialEq for CustomAnnotation
Source§fn eq(&self, other: &CustomAnnotation) -> bool
fn eq(&self, other: &CustomAnnotation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for CustomAnnotation
impl StructuralPartialEq for CustomAnnotation
Auto Trait Implementations§
impl Freeze for CustomAnnotation
impl RefUnwindSafe for CustomAnnotation
impl Send for CustomAnnotation
impl Sync for CustomAnnotation
impl Unpin for CustomAnnotation
impl UnsafeUnpin for CustomAnnotation
impl UnwindSafe for CustomAnnotation
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