pub struct ImplBlock { /* private fields */ }Expand description
An impl block.
Implementations§
Source§impl ImplBlock
Constants
impl ImplBlock
Constants
Sourcepub fn add_constant(&mut self, constant: ConstInit)
pub fn add_constant(&mut self, constant: ConstInit)
Adds the constant.
Sourcepub fn with_constant(self, constant: ConstInit) -> Self
pub fn with_constant(self, constant: ConstInit) -> Self
Adds the constant.
Sourcepub fn write_constants(&self, b: &mut CodeBuffer, level: usize)
pub fn write_constants(&self, b: &mut CodeBuffer, level: usize)
Adds the constant.
Trait Implementations§
Source§impl Statement for ImplBlock
impl Statement for ImplBlock
Source§fn write(&self, b: &mut CodeBuffer, level: usize)
fn write(&self, b: &mut CodeBuffer, level: usize)
Writes the code to the buffer
b at the indent level.Source§impl WithComments for ImplBlock
impl WithComments for ImplBlock
Source§fn add_comment<S>(&mut self, comment: S)
fn add_comment<S>(&mut self, comment: S)
Adds the
comment line.Source§fn with_comment<S>(self, comment: S) -> Self
fn with_comment<S>(self, comment: S) -> Self
Adds the
comment line.Source§fn write_comments(
&self,
comment_type: CommentType,
b: &mut CodeBuffer,
level: usize,
)
fn write_comments( &self, comment_type: CommentType, b: &mut CodeBuffer, level: usize, )
Writes the comment lines.
Source§impl WithFunctions for ImplBlock
impl WithFunctions for ImplBlock
Source§fn add_function<F>(&mut self, function: F)
fn add_function<F>(&mut self, function: F)
Adds the
function.Source§fn with_function<F>(self, function: F) -> Self
fn with_function<F>(self, function: F) -> Self
Adds the
function.Source§fn write_functions(&self, b: &mut CodeBuffer, level: usize)
fn write_functions(&self, b: &mut CodeBuffer, level: usize)
Writes the functions.
Source§impl WithGenerics for ImplBlock
impl WithGenerics for ImplBlock
Source§fn add_generic<V>(&mut self, generic: V)
fn add_generic<V>(&mut self, generic: V)
Adds the
generic type parameter.Source§fn with_generic<V>(self, generic: V) -> Self
fn with_generic<V>(self, generic: V) -> Self
Adds the
generic type parameter.Source§fn write_generic_brackets(&self, b: &mut CodeBuffer)
fn write_generic_brackets(&self, b: &mut CodeBuffer)
Writes the generic brackets. (ex:
<A: TypeA, B: TypeB>)Source§impl WithRustType for ImplBlock
impl WithRustType for ImplBlock
Source§fn write_rust_type(&self, b: &mut CodeBuffer)
fn write_rust_type(&self, b: &mut CodeBuffer)
Writes the Rust type.
Source§impl WithTypeDecs for ImplBlock
impl WithTypeDecs for ImplBlock
Source§fn add_type_dec<D>(&mut self, type_dec: D)
fn add_type_dec<D>(&mut self, type_dec: D)
Adds the
type_dec.Source§fn with_type_dec<D>(self, type_dec: D) -> Self
fn with_type_dec<D>(self, type_dec: D) -> Self
Adds the
type_dec.Source§fn write_type_decs(&self, b: &mut CodeBuffer, level: usize)
fn write_type_decs(&self, b: &mut CodeBuffer, level: usize)
Writes the type declarations.
Auto Trait Implementations§
impl Freeze for ImplBlock
impl !RefUnwindSafe for ImplBlock
impl !Send for ImplBlock
impl !Sync for ImplBlock
impl Unpin for ImplBlock
impl !UnwindSafe for ImplBlock
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