Title: Add a way to resize StackFutures · Issue #6 · microsoft/stackfuture · GitHub
Open Graph Title: Add a way to resize StackFutures · Issue #6 · microsoft/stackfuture
X Title: Add a way to resize StackFutures · Issue #6 · microsoft/stackfuture
Description: It'd be helpful to have a way to shrink (or less commonly, grow) a StackFuture. For example, sometimes you have an object that implements a trait and needs to forward calls to another object that implements the same trait. Right now that...
Open Graph Description: It'd be helpful to have a way to shrink (or less commonly, grow) a StackFuture. For example, sometimes you have an object that implements a trait and needs to forward calls to another object that i...
X Description: It'd be helpful to have a way to shrink (or less commonly, grow) a StackFuture. For example, sometimes you have an object that implements a trait and needs to forward calls to another object th...
Opengraph URL: https://github.com/microsoft/stackfuture/issues/6
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add a way to resize StackFutures","articleBody":"It'd be helpful to have a way to shrink (or less commonly, grow) a `StackFuture`. For example, sometimes you have an object that implements a trait and needs to forward calls to another object that implements the same trait. Right now that's impossible with `StackFuture` without boxing the child future because otherwise you'd have to have a future contain a future that's the same size as itself. That said, there will usually be some extra space so we might be able to dynamically shrink a `StackFuture`. \r\n\r\nThe signature would probably be something like:\r\n```rust\r\nfn resize\u003cconst NEW_SIZE: usize\u003e(self) -\u003e Result\u003cStackFuture\u003cT, NEW_SIZE\u003e, Self\u003e;\r\n```\r\n\r\nThen using this would look something like:\r\n```rust\r\nimpl Foo for MyObject {\r\n fn bar(\u0026self) -\u003e StackFuture\u003c(), 1000\u003e {\r\n match self.sub_object.bar().resize::\u003c{500}\u003e() {\r\n Ok(f) =\u003e f.await,\r\n Err(original) =\u003e Box::pin(original).await,\r\n }\r\n }\r\n}\r\n```\r\nThe idea here is we'd try to fit the future into a smaller container, but if it doesn't fit then the `resize` returns the original future and we can either decide to pay the allocation cost (as we did in this example) or give up.","author":{"url":"https://github.com/eholk","@type":"Person","name":"eholk"},"datePublished":"2022-08-08T19:17:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/6/stackfuture/issues/6"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9efd6195-c33a-5212-959d-faf1b562ebb9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D7FE:3F9146:38E856B:3A7C56F:6A6348C0 |
| html-safe-nonce | df9f0b86927acd258498e0f874f31102b0111afa13ee93d622e14206cde39bf6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0ZFOjNGOTE0NjozOEU4NTZCOjNBN0M1NkY6NkE2MzQ4QzAiLCJ2aXNpdG9yX2lkIjoiNTY3MzM4NzQ0MDI2ODg1NTQ4OCIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9 |
| visitor-hmac | c2e61c7321fc8a5c7e21f0126a0ca254ab6032d44163c977ffba5e3ed590546b |
| hovercard-subject-tag | issue:1332289481 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/stackfuture/6/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fada1ff796d9431ba5d573a93ee5df92c9255b4bd4f73d41163684e0493d7d3f/microsoft/stackfuture/issues/6 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fada1ff796d9431ba5d573a93ee5df92c9255b4bd4f73d41163684e0493d7d3f/microsoft/stackfuture/issues/6 |
| og:image:alt | It'd be helpful to have a way to shrink (or less commonly, grow) a StackFuture. For example, sometimes you have an object that implements a trait and needs to forward calls to another object that i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | eholk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 59e55daad7174ca59d63c6974d58276ccb5477442e550bebb3c035e1bef11c94 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/stackfuture git https://github.com/microsoft/stackfuture.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 515774180 |
| octolytics-dimension-repository_nwo | microsoft/stackfuture |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 515774180 |
| octolytics-dimension-repository_network_root_nwo | microsoft/stackfuture |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 990295d92a4cc7b63fbbd83a046217cd7d77d49c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width