pub struct StorageSpec {
pub required: bool,
pub max_length: Option<usize>,
pub precision: Option<u8>,
pub scale: Option<u8>,
pub default: Option<Value>,
pub unique: bool,
pub indexed: bool,
pub renamed_from: Option<String>,
}Expand description
字段的数据库存储语义。
Fields§
§required: bool是否允许缺失/NULL。
max_length: Option<usize>字符串存储上限。
precision: Option<u8>DECIMAL 精度。
scale: Option<u8>DECIMAL 小数位数。
default: Option<Value>数据库默认值。
unique: bool是否建立唯一索引。
indexed: bool是否建立普通索引。
renamed_from: Option<String>显式声明该字段由哪个旧列原位改名而来。
Trait Implementations§
Source§impl Clone for StorageSpec
impl Clone for StorageSpec
Source§fn clone(&self) -> StorageSpec
fn clone(&self) -> StorageSpec
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 StorageSpec
impl Debug for StorageSpec
Source§impl Default for StorageSpec
impl Default for StorageSpec
Source§fn default() -> StorageSpec
fn default() -> StorageSpec
Returns the “default value” for a type. Read more
impl Eq for StorageSpec
Source§impl PartialEq for StorageSpec
impl PartialEq for StorageSpec
impl StructuralPartialEq for StorageSpec
Auto Trait Implementations§
impl Freeze for StorageSpec
impl RefUnwindSafe for StorageSpec
impl Send for StorageSpec
impl Sync for StorageSpec
impl Unpin for StorageSpec
impl UnsafeUnpin for StorageSpec
impl UnwindSafe for StorageSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more