Stepan Koltsov
Stepan Koltsov
`From` implementation is suboptimal: can be optimized for certain representations of `Bytes`.
Replace copy-paste `promotable_even_clone`/`protomotable_odd_clone` and `promotable_even_drop`/`protomotable_odd_drop` into `promotable_clone` and `protomotable_drop` functions parameterized by `ProtomotableEvenness`. Diffstat is: ``` src/bytes.rs | 71 ++++++++++++++++++++++++++++++++++++----------------------------------- 1 file changed, 36 insertions(+), 35 deletions(-) ``` but it...
`BufQueue` is a `VecDeque` which implements `Buf` and caches the remaining size. This utility can be used to implement outgoing network buffer. Imagine this use case: ``` type Header =...
Create a new `SharedInline` `Bytes` representation, which is: ``` struct SharedInline { ref_cnt: AtomicUsize, cap: usize, // data: [u8; cap], } ``` The advantage of this representation is that we...
Partial fix for #12. Edit: updated a patch. `Loop` destructor marks all loop handles dead, so any further `poll` requests fail (they currently panic, but should probably return an error)....
Code: ``` extern crate tokio_core; extern crate futures; use tokio_core::Loop; use futures::stream::Stream; #[test] fn recv_after_close() { let mut lp: Loop = Loop::new().unwrap(); let (sender, receiver) = lp.handle().channel::(); let receiver =...
An example: ``` ``` is rendered on the server (using react server-side rendering) and then re-rendered on the client using exactly the same argument. When it is re-rendered on the...
`example` is not mentioned in `.circleci` or `.github` folders. And locally `yarn example` fails on my laptop with: ``` % yarn example yarn run v1.22.4 $ parcel example/index.html (node:9237) UnhandledPromiseRejectionWarning:...
`Editor` component could have public functions like: ``` // like HTMLTextareaElement selectionStart: number selectionEnd: number setSelectionRange(start, end) setValue(text) // raw text; should apply highlighting, preserve selection and amend history ```...