П
https://docs.rs/tokio-tungstenite/0.11.0/src/tokio_tungstenite/lib.rs.html#158
https://github.com/snapview/tungstenite-rs/blob/master/src/handshake/server.rs#L223
Size: a a a
П
Э
П
АД
&mut self (как и &self) в сигнатуре функции — это сокращённая форма записи self: &mut Self. Поэтому в теле функции кейворд self ассоциируется со ссылкой на Self, а не со значением.Э
fn foo(&must self) {
let a = &mut self;
}a получается let a: &mut &mut SelfАД
Э
&mut &mut Self вместо &mut Self.Э
let outer = SomeFutureCollector::new();
let callback = || {
let fut = tokio::runtime::Handle::current().spawn(/* async block or function here */);
outer.push(fut);
};
block_on() вместо spawn.Э
П
Э
АК
error[E0277]: the size for values of type `(dyn std::error::Error + 'static)` cannot be known at compilation time
--> src\matcher.rs:135:33
|
89 | pub trait MatchStrategy {
| ------------- required by a bound in this
...
92 | type MatchErr: std::error::Error;
| ----------------- required by this bound in `matcher::strategies::MatchStrategy`
...
135 | type MatchErr = Box<dyn Error>;
| ^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::error::Error + 'static)`
= note: required because of the requirements on the impl of `std::error::Error` for `std::boxed::Box<(dyn std::error::Error + 'static)>`
АК
BV
АК
АК
АК
BV
АК
BV