Struct datamodel_renderer::datamodel::FieldType
source · pub struct FieldType<'a> { /* private fields */ }
Expand description
A type of a field in the datamodel.
Implementations§
source§impl<'a> FieldType<'a>
impl<'a> FieldType<'a>
sourcepub fn required(name: impl Into<Cow<'a, str>>) -> Self
pub fn required(name: impl Into<Cow<'a, str>>) -> Self
The field is required, rendered with only the name of the
type. For example: Int
.
The name will be sanitized, removing unsupported characters.
sourcepub fn into_optional(&mut self)
pub fn into_optional(&mut self)
Convert the field type to optional.
sourcepub fn into_array(&mut self)
pub fn into_array(&mut self)
Convert the field type to array.
sourcepub fn into_unsupported(&mut self)
pub fn into_unsupported(&mut self)
Set the field type to be unsupported by Prisma.
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for FieldType<'a>
impl<'a> Send for FieldType<'a>
impl<'a> Sync for FieldType<'a>
impl<'a> Unpin for FieldType<'a>
impl<'a> UnwindSafe for FieldType<'a>
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