- 27 7月, 2016 11 次提交
-
-
由 Steve Klabnik 提交于
Improve Open doc Part of #29356. r? @steveklabnik
-
由 Steve Klabnik 提交于
Dir entry doc Part of #29356. r? @steveklabnik
-
由 Steve Klabnik 提交于
Fix HashMap's values_mut example to use println! Fix HashMap's values_mut example to use println!
-
由 Steve Klabnik 提交于
Add DirBuilder doc examples r? @steveklabnik Part of #29329 and of #29356.
-
由 Steve Klabnik 提交于
Update underscore usage (#34903)
-
由 Steve Klabnik 提交于
Update VecDeque documentation to specify direction of index 0 (#34920) I mentioned the direction for all the methods that work with an index
-
由 Steve Klabnik 提交于
Add HashMap Entry enums examples Part of #29348. r? @steveklabnik
-
由 Steve Klabnik 提交于
doc: add missing pause
-
由 Steve Klabnik 提交于
document DoubleEndedIterator::next_back document DoubleEndedIterator::next_back fixes #34726
-
由 Steve Klabnik 提交于
Add more docs - mostly warnings - to std::mem::transmute
-
由 Steve Klabnik 提交于
Fix ABI string docs in reference.md
-
- 25 7月, 2016 1 次提交
-
-
由 bors 提交于
Rollup of 7 pull requests - Successful merges: #34965, #34972, #34975, #34976, #34977, #34988, #34989 - Failed merges:
-
- 24 7月, 2016 12 次提交
-
-
由 Guillaume Gomez 提交于
-
由 Guillaume Gomez 提交于
-
由 Guillaume Gomez 提交于
-
由 Manish Goregaokar 提交于
Fix incorrect 'memory leak' example for `Vec::set_len`. Example was written in https://github.com/rust-lang/rust/pull/34911 Issue was brought up in this comment: https://github.com/rust-lang/rust/commit/a005b2cd2ac679da7393e537aa05e2b7d32d36d5#commitcomment-18346958
-
由 Manish Goregaokar 提交于
Doc example improvements for `slice::windows`. * Modify existing example to not rely on printing to see results * Add an example demonstrating when slice is shorter than `size`
-
由 Manish Goregaokar 提交于
Fixed to spelling errors in char.rs Fixed two small spelling mistakes (interator -> iterator) in the documentation for encode_utf8 and encode_utf16
-
由 Manish Goregaokar 提交于
Add BuildHasher example r? @steveklabnik
-
由 Manish Goregaokar 提交于
Add Random state doc Last part of #29348. r? @steveklabnik
-
由 Manish Goregaokar 提交于
improve const eval error reporting on "" and b"" casts r? @EddyB cc @ubsan
-
由 Manish Goregaokar 提交于
Remove unused methods from MultiSpan Removed a couple of unused methods from MultiSpan. I thought about batching this with some other changes but wasn't sure when I'd get around to them, so PR for a tiny fix instead. This can be rollup'd.
-
由 Robert Williamson 提交于
-
由 bors 提交于
Implement rust_eh_personality in Rust, remove rust_eh_personality_catch. Well, not quite: ARM EHABI platforms still use the old scheme -- for now. r? @alexcrichton
-
- 23 7月, 2016 7 次提交
-
-
由 Corey Farwell 提交于
* Modify existing example to not rely on printing to see results * Add an example demonstrating when slice is shorter than `size`
-
由 Corey Farwell 提交于
Example was written in https://github.com/rust-lang/rust/pull/34911 Issue was brought up in this comment: https://github.com/rust-lang/rust/commit/a005b2cd2ac679da7393e537aa05e2b7d32d36d5#commitcomment-18346958
-
由 abhi 提交于
-
由 Guillaume Gomez 提交于
-
由 Vadim Chugunov 提交于
Well, not quite: ARM EHABI platforms still use the old scheme -- for now.
-
由 bors 提交于
Added empty CloseDelim to tokens for future use. Description says it all. I added a new DelimToken type, Empty, to indicate a Delimited tokenstream with no actual delimiters (which are variously useful for constructing macro output). r? @nrc
-
- 22 7月, 2016 9 次提交
-
-
由 Camille Roussel 提交于
Fixed two small spelling mistakes (interator -> iterator) in the documentation for encode_utf8 and encode_utf16
-
由 ggomez 提交于
-
由 bors 提交于
Fix wrong condition in base::internalize_symbols(). Fix a typo that snuck into https://github.com/rust-lang/rust/pull/34899 (and completely broke `internalize_symbols()`).
-
由 ggomez 提交于
-
由 ggomez 提交于
-
由 abhi 提交于
-
由 bors 提交于
Add method `String::insert_str`
-
由 Oliver Schneider 提交于
-
由 bors 提交于
Add a method to the mpsc::Receiver for producing a non-blocking iterator Currently, the `mpsc::Receiver` offers methods for receiving values in both blocking (`recv`) and non-blocking (`try_recv`) flavours. However only blocking iteration over values is supported. This PR adds a non-blocking iterator to complement the `try_recv` method, just as the blocking iterator complements the `recv` method. Use-case ------------- I predominantly use rust in my work on real-time systems and in particular real-time audio generation/processing. I use `mpsc::channel`s to communicate between threads in a purely non-blocking manner. I.e. I might send messages from the GUI thread to the audio thread to update the state of the dsp-graph, or from the audio thread to the GUI thread to display the RMS of each node. These are just a couple examples (I'm probably using 30+ channels across my various projects). I almost exclusively use the `mpsc::Receiver::try_recv` method to avoid blocking any of the real-time threads and causing unwanted glitching/stuttering. Now that I mention it, I can't think of a single time that I personally have used the `recv` method (though I can of course see why it would be useful, and perhaps the common case for many people). As a result of this experience, I can't help but feel there is a large hole in the `Receiver` API. | blocking | non-blocking | |------------|--------------------| | `recv` | `try_recv` | | `iter` |
🙀 | For the most part, I've been working around this using `while let Ok(v) = r.try_recv() { ... }`, however as nice as this is, it is clearly no match for the Iterator API. As an example, in the majority of my channel use cases I only want to check for *n* number of messages before breaking from the loop so that I don't miss the audio IO callback or hog the GUI thread for too long when an unexpectedly large number of messages are sent. Currently, I have to write something like this: ```rust let mut take = 100; while let Ok(msg) = rx.try_recv() { // Do stuff with msg if take == 0 { break; } take -= 1; } ``` or wrap the `try_recv` call in a `Range<usize>`/`FilterMap` iterator combo. On the other hand, this PR would allow for the following: ```rust for msg in rx.try_iter().take(100) { // Do stuff with msg } ``` I imagine this might also be useful to game devs, embedded or anyone doing message passing across real-time threads.
-