pub struct RustSafeName { /* private fields */ }Expand description
A name as the database spells it, together with the identifier Rust can spell it as.
The EXTERNAL name is never rewritten: it is what reaches a CREATE TABLE, a SELECT, and the
rename attribute an emitted row carries — so a declaration that says rename = "bit-rate"
gets a column called bit-rate, whatever the field holding it has to be called.
Implementations§
Source§impl RustSafeName
impl RustSafeName
Sourcepub fn new(external: impl Into<String>, span: Span) -> Self
pub fn new(external: impl Into<String>, span: Span) -> Self
A name from whatever a declaration wrote, mangled into an identifier as needed.
span is the token the name was declared at, so an emitted field points back at the
declaration and a refusal about it reports there.
That it is CARRIED is pinned by ingraph-derive’s tests/span_pins.rs, at the column of a
real compiler’s caret. A span is observable nowhere else: proc-macro2 holds every location
behind its span-locations feature, and without it Debug renders the constant Span — so a
unit test comparing two renderings holds for any emitter at all, which is exactly what the
assertion that used to sit in tests.rs beside this one did.
Sourcepub fn from_ident(ident: &Ident) -> Self
pub fn from_ident(ident: &Ident) -> Self
A name from a record’s own FIELD, which is already an identifier.
The external face drops a raw prefix: r#type is how Rust spells a field called type, and
type is what the column is called.
Trait Implementations§
Source§impl Clone for RustSafeName
impl Clone for RustSafeName
Source§impl Debug for RustSafeName
impl Debug for RustSafeName
Source§impl Display for RustSafeName
The EXTERNAL face — string literals, error messages, and the rename attributes an emitted row
carries.
impl Display for RustSafeName
The EXTERNAL face — string literals, error messages, and the rename attributes an emitted row
carries.
impl Eq for RustSafeName
Source§impl Hash for RustSafeName
impl Hash for RustSafeName
Source§impl PartialEq for RustSafeName
impl PartialEq for RustSafeName
impl StructuralPartialEq for RustSafeName
Source§impl ToTokens for RustSafeName
The RUST face — quoting a name always yields valid Rust.
impl ToTokens for RustSafeName
The RUST face — quoting a name always yields valid Rust.
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations§
impl !Send for RustSafeName
impl !Sync for RustSafeName
impl Freeze for RustSafeName
impl RefUnwindSafe for RustSafeName
impl Unpin for RustSafeName
impl UnsafeUnpin for RustSafeName
impl UnwindSafe for RustSafeName
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.