pub struct IdPolicy { /* private fields */ }Expand description
ID field and transform policy.
Implementations§
Source§impl IdPolicy
impl IdPolicy
pub fn new(generation: IdGeneration) -> IdPolicy
pub fn with_database_uuid_support(self, supports_uuid: bool) -> IdPolicy
pub fn with_force_allow_id(self, force_allow_id: bool) -> IdPolicy
pub fn field(self) -> DbField
pub fn transform_input(self, value: Option<&str>) -> Option<IdValue>
pub fn transform_output(self, value: Option<IdValue>) -> Option<String>
Trait Implementations§
impl Copy for IdPolicy
Source§impl<'de> Deserialize<'de> for IdPolicy
impl<'de> Deserialize<'de> for IdPolicy
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IdPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IdPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for IdPolicy
Source§impl Serialize for IdPolicy
impl Serialize for IdPolicy
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for IdPolicy
Auto Trait Implementations§
impl Freeze for IdPolicy
impl RefUnwindSafe for IdPolicy
impl Send for IdPolicy
impl Sync for IdPolicy
impl Unpin for IdPolicy
impl UnsafeUnpin for IdPolicy
impl UnwindSafe for IdPolicy
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.