pin-project icon indicating copy to clipboard operation
pin-project copied to clipboard

Add pub prefix to args to make the method and the returned struct

Open louwenus opened this issue 4 months ago • 3 comments

Behavior on existing syntax is kept as is. The new syntax look like this:

# use pin_project::pin_project
#[pin_project(pub project = StructProj)] //force the project method and StructProj to be pub
pub struct Struct<T> {
    #[pin]
    field: T,
}

pub prefix can also be used on project_ref and (named) project_replace

fix #361

louwenus avatar Aug 24 '25 16:08 louwenus