Struct binary_util::Impl
source · pub struct Impl { /* private fields */ }
Expand description
Defines an impl block.
Implementations§
source§impl Impl
impl Impl
sourcepub fn generic(&mut self, name: &str) -> &mut Impl
pub fn generic(&mut self, name: &str) -> &mut Impl
Add a generic to the impl block.
This adds the generic for the block (impl<T>
) and not the target type.
sourcepub fn target_generic<T>(&mut self, ty: T) -> &mut Implwhere
T: Into<Type>,
pub fn target_generic<T>(&mut self, ty: T) -> &mut Implwhere T: Into<Type>,
Add a generic to the target type.
sourcepub fn impl_trait<T>(&mut self, ty: T) -> &mut Implwhere
T: Into<Type>,
pub fn impl_trait<T>(&mut self, ty: T) -> &mut Implwhere T: Into<Type>,
Set the trait that the impl block is implementing.
sourcepub fn macro(&mut self, macro: &str) -> &mut Impl
pub fn macro(&mut self, macro: &str) -> &mut Impl
Add a macro to the impl block (e.g. "#[async_trait]"
)
sourcepub fn associate_type<T>(&mut self, name: &str, ty: T) -> &mut Implwhere
T: Into<Type>,
pub fn associate_type<T>(&mut self, name: &str, ty: T) -> &mut Implwhere T: Into<Type>,
Set an associated type.
sourcepub fn bound<T>(&mut self, name: &str, ty: T) -> &mut Implwhere
T: Into<Type>,
pub fn bound<T>(&mut self, name: &str, ty: T) -> &mut Implwhere T: Into<Type>,
Add a where
bound to the impl block.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Impl
impl Send for Impl
impl Sync for Impl
impl Unpin for Impl
impl UnwindSafe for Impl
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