10000 GitHub - MashPlant/ptr_project
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

MashPlant/ptr_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This crate is inspired by pin-project. It enables safe and ergonomic pointer projection.

Usage

Currently you need to enable feature arbitrary_self_types to use this proc macro.

Example:

#![feature(arbitrary_self_types)]

#[ptr_project::ptr_project]
struct Struct<T, U> {
  t: T,
  u: U,
}

impl<T, U> Struct<T, U> {
  fn method(self: *const Self) {
    let this = self.project();
    let _: *const T = this.t;
    let _: *const U = this.u;
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0