Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide way to import projection trait #80

Closed
taiki-e opened this issue Sep 9, 2019 · 3 comments
Closed

Provide way to import projection trait #80

taiki-e opened this issue Sep 9, 2019 · 3 comments
Labels
A-project-attribute Area: #[project], #[project_ref], and #[project_replace] (note: this was removed in v1.0)

Comments

@taiki-e
Copy link
Owner

taiki-e commented Sep 9, 2019

The current project/project_into methods are trait-methods, so it needs to use glob import to use it from other modules.

We could probably provide the following way:

#[pin_project]
struct Foo<T> {
    #[pin]
    field: T,
}
mod bar {
    #[project]
    use super::Foo;
    // convert to
    use super::__FooProjectionTrait;
}
@taiki-e
Copy link
Owner Author

taiki-e commented Sep 11, 2019

Blocked on #21 (comment)

@withoutboats
Copy link

withoutboats commented Sep 16, 2019

Didn't search very hard but: why do you need the trait? I thought we made pin #[fundamental]?

edit: sorry, fundamental isn't relevant here.. but shouldnt they be valid inherent methods?

edit2: found #89, understand what happened now.

@taiki-e
Copy link
Owner Author

taiki-e commented Sep 17, 2019

Closing this in favor of #89.

@taiki-e taiki-e closed this as completed Sep 17, 2019
@taiki-e taiki-e removed this from the v0.4 milestone Sep 23, 2019
@taiki-e taiki-e added A-pin-projection Area: #[pin_project] A-project-attribute Area: #[project], #[project_ref], and #[project_replace] (note: this was removed in v1.0) and removed A-pin-projection Area: #[pin_project] labels Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-project-attribute Area: #[project], #[project_ref], and #[project_replace] (note: this was removed in v1.0)
Projects
None yet
Development

No branches or pull requests

2 participants