pub struct TsClass {
pub name: String,
pub description: Option<String>,
pub members: Vec<TsMember>,
pub examples: Vec<String>,
}Expand description
Class definition
Fields§
§name: StringClass name
description: Option<String>Description
members: Vec<TsMember>Members
examples: Vec<String>Examples
Implementations§
Source§impl TsClass
impl TsClass
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 with_example(self, example: impl Into<String>) -> Self
pub fn with_example(self, example: impl Into<String>) -> Self
Adds an example
Sourcepub fn to_ts_declaration(&self) -> String
pub fn to_ts_declaration(&self) -> String
Generates TypeScript declaration
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TsClass
impl<'de> Deserialize<'de> for TsClass
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 TsClass
impl RefUnwindSafe for TsClass
impl Send for TsClass
impl Sync for TsClass
impl Unpin for TsClass
impl UnsafeUnpin for TsClass
impl UnwindSafe for TsClass
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