pub struct Field {
pub name: String,
pub ty: Type,
pub documentation: String,
pub annotation: Vec<String>,
pub value: String,
pub visibility: Option<String>,
}
Expand description
Defines a struct field.
Fields
name: String
Field name
ty: Type
Field type
documentation: String
Field documentation
annotation: Vec<String>
Field annotation
value: String
Field value
visibility: Option<String>
The visibility of the field
Implementations
sourceimpl Field
impl Field
sourcepub fn new<T>(name: &str, ty: T) -> Selfwhere
T: Into<Type>,
pub fn new<T>(name: &str, ty: T) -> Selfwhere
T: Into<Type>,
Return a field definition with the provided name and type
sourcepub fn doc(&mut self, documentation: impl Into<String>) -> &mut Self
pub fn doc(&mut self, documentation: impl Into<String>) -> &mut Self
Set field’s documentation.
sourcepub fn annotation(&mut self, annotation: impl Into<String>) -> &mut Self
pub fn annotation(&mut self, annotation: impl Into<String>) -> &mut Self
Set field’s annotation.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnwindSafe for Field
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more