#[non_exhaustive]pub struct TextLimits {
pub longest_varchar: Option<u32>,
pub counted_in: VarcharUnit,
pub source: LimitSource,
pub text_is_not: Option<&'static str>,
}Expand description
What one engine holds in a text column: the longest varchar(n) it
takes, how that length is counted, where the number came from, and what an
unbounded text column cannot be there.
Answered by DialectCapabilities::text_limits. A length past the
longest is refused by name before anything is rendered, as a decimal wider
than the engine holds is.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.longest_varchar: Option<u32>The longest varchar(n) a column takes, where the engine has one.
counted_in: VarcharUnitHow Self::longest_varchar is counted.
source: LimitSourceWhere the number came from.
text_is_not: Option<&'static str>What the engine refuses an unbounded text column as, where it
refuses it as a key — a key or UNIQUE, a primary key.
Implementations§
Source§impl TextLimits
impl TextLimits
Sourcepub const fn new(
longest_varchar: u32,
counted_in: VarcharUnit,
source: LimitSource,
) -> Self
pub const fn new( longest_varchar: u32, counted_in: VarcharUnit, source: LimitSource, ) -> Self
A longest varchar, counted in counted_in, from source.
Sourcepub const fn and_text_is_not(self, what: &'static str) -> Self
pub const fn and_text_is_not(self, what: &'static str) -> Self
The same limits, for an engine that refuses an unbounded text as
what — a key or UNIQUE.
Trait Implementations§
Source§impl Clone for TextLimits
impl Clone for TextLimits
impl Copy for TextLimits
Source§impl Debug for TextLimits
impl Debug for TextLimits
impl Eq for TextLimits
Source§impl PartialEq for TextLimits
impl PartialEq for TextLimits
impl StructuralPartialEq for TextLimits
Auto Trait Implementations§
impl Forget for TextLimits
impl Freeze for TextLimits
impl Move for TextLimits
impl RefUnwindSafe for TextLimits
impl Send for TextLimits
impl Sync for TextLimits
impl Unpin for TextLimits
impl UnsafeUnpin for TextLimits
impl UnwindSafe for TextLimits
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