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>,
pub native_enum: 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>显式声明该字段由哪个旧列原位改名而来。
native_enum: Option<String>PostgreSQL 原生枚举类型名;仅 Radio 字段可声明。
Trait Implementations§
Source§impl Clone for StorageSpec
impl Clone for StorageSpec
Source§impl Debug for StorageSpec
impl Debug for StorageSpec
Source§impl Default for StorageSpec
impl Default for StorageSpec
impl Eq for StorageSpec
Source§impl PartialEq for StorageSpec
impl PartialEq for StorageSpec
impl StructuralPartialEq for StorageSpec
Auto Trait Implementations§
impl Forget for StorageSpec
impl Freeze for StorageSpec
impl Move 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