Struct Renderer
struct Renderer<'w, W> {
column: usize,
indent: usize,
inline: bool,
out: &'w mut W,
}Expand description
Writes IDL text and counts the column it writes to.
Fields§
§column: usize§indent: usize§inline: boolWhether every list goes on one line, including nested ones.
out: &'w mut WImplementations§
§impl<W: Write> Renderer<'_, W>
impl<W: Write> Renderer<'_, W>
fn doc(&mut self, doc: Option<&Doc>) -> Result
fn error_def(&mut self, error: &ErrorDef<'_>) -> Result
fn fields(&mut self, fields: &[Field<'_>]) -> Result
fn fields_inline(&mut self, fields: &[Field<'_>]) -> Result
fn fits(
&self,
render: impl FnOnce(&mut Renderer<'_, Counter>) -> Result,
) -> bool
fn fits( &self, render: impl FnOnce(&mut Renderer<'_, Counter>) -> Result, ) -> bool
Returns whether render stays within the column limit from the
current column, with every list on one line.
fn inlined(&mut self, render: impl FnOnce(&mut Self) -> Result) -> Result
fn inlined(&mut self, render: impl FnOnce(&mut Self) -> Result) -> Result
Runs render with every list on one line.
fn interface(&mut self, interface: &Interface<'_>) -> Result
fn method(&mut self, method: &Method<'_>) -> Result
fn newline(&mut self) -> Result
fn ty(&mut self, ty: Type<'_>) -> Result
fn type_def(&mut self, ty: &TypeDef<'_>) -> Result
fn variants(&mut self, variants: &[Variant<'_>]) -> Result
fn variants_inline(&mut self, variants: &[Variant<'_>]) -> Result
Trait Implementations§
Auto Trait Implementations§
impl<'w, W> !UnwindSafe for Renderer<'w, W>
impl<'w, W> Freeze for Renderer<'w, W>
impl<'w, W> RefUnwindSafe for Renderer<'w, W>where
&'w mut W: RefUnwindSafe,
impl<'w, W> Send for Renderer<'w, W>
impl<'w, W> Sync for Renderer<'w, W>
impl<'w, W> Unpin for Renderer<'w, W>
impl<'w, W> UnsafeUnpin for Renderer<'w, W>where
&'w mut W: UnsafeUnpin,
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