pub struct TsInterface {
pub name: String,
pub description: Option<String>,
pub fields: Vec<(String, TsType, Option<String>)>,
}Expand description
Interface definition
Fields§
§name: StringInterface name
description: Option<String>Description
fields: Vec<(String, TsType, Option<String>)>Fields
Implementations§
Source§impl TsInterface
impl TsInterface
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Sets a description
Sourcepub fn field_with_description(
self,
name: impl Into<String>,
ty: TsType,
description: impl Into<String>,
) -> Self
pub fn field_with_description( self, name: impl Into<String>, ty: TsType, description: impl Into<String>, ) -> Self
Adds a field with description
Sourcepub fn to_ts_declaration(&self) -> String
pub fn to_ts_declaration(&self) -> String
Generates TypeScript declaration
Trait Implementations§
Source§impl Clone for TsInterface
impl Clone for TsInterface
Source§fn clone(&self) -> TsInterface
fn clone(&self) -> TsInterface
Returns a duplicate of the value. Read more
1.0.0 · 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 TsInterface
impl Debug for TsInterface
Source§impl<'de> Deserialize<'de> for TsInterface
impl<'de> Deserialize<'de> for TsInterface
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TsInterface
impl RefUnwindSafe for TsInterface
impl Send for TsInterface
impl Sync for TsInterface
impl Unpin for TsInterface
impl UnsafeUnpin for TsInterface
impl UnwindSafe for TsInterface
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