Considerations for writing a loop over a Stream as it relates to await syntax.
JavaScript uses this syntax:
for await (elem of stream) {
// ...
}
/* | |
Psuedocode from signal: | |
calculate_key_pair(k): | |
E = kB | |
A.y = E.y | |
A.s = 0 | |
if E.s == 1: | |
a = -k (mod q) |
Considerations for writing a loop over a Stream as it relates to await syntax.
JavaScript uses this syntax:
for await (elem of stream) {
// ...
}
We add a built in attribute for handling pin projection:
struct MyCombinator<F> {
#[pin_accessor]
field: F,
}
This generates a method fn field_pin(self: PinMut<'_, Self>) -> PinMut<'_, F>
, and also generates these constraints:
This is a list of potential use cases for something like alternative registries & some analysis of how to solve these use cases.
As context, a registry contains two network service components:
I want to host my own crates separately from crates.io, to serve to people with appropriate access.
Our great anguish around error handling is the incorrectness of the Error trait. Here's an easy way to solve the problem: fix the error trait. Literally: just change the existing trait so that it is correct.
Description is already being deprecated, with a default method provided. Done and done.
(Note: this is posted as a gist because my primary blog host is having some trouble today, and I can't get my blog to deploy. It will be on my blog eventually.)
[Last time][async-methods-i], we introduced the idea of async methods, and talked about how they would be implemented: as a kind of anonymous associated type on the trait that declares the method, which corresponds to a different, anonymous future type for each implementation of that method. Starting this
Goal:
trait MyTrait {
async fn foo(&self) -> i32;
}
impl MyTrait for MyType {
async fn foo(&self) -> i32 {
/* ... * /
#[macro_use] extern crate cargonauts; | |
use cargonauts::futures::{Future, future}; | |
use cargonauts::resources::{Resource, Environment, Error}; | |
use cargonauts::methods::Get; | |
use cargonauts::formats::Debug; | |
routes! { | |
resource Echo { | |
method Get in Debug; |