Intro to Tower and the Service Trait - Stefan Baumgartner - Rust Linz, July 2022

  Рет қаралды 16,619

Rust

Rust

Күн бұрын

Пікірлер: 6
@leonie9248
@leonie9248 2 жыл бұрын
Thanks for sharing this presentation!
@marti-nito
@marti-nito 2 жыл бұрын
I found this intro extremely helpfull, especially the part around 6:35. However I have one question: Wouldn't it make more sense to put the trait bounds of the Logger Service implementation directly on the Logger struct (or at least the Logger impl block)? After all, an e.g. Logger implementation doesn't really make sense, does it? Or is that just not possible with (current) rust?
@sbaumg
@sbaumg 2 жыл бұрын
Yes and no. A Logger won't make sense, that's true, but by moving the trait bounds to the trait impl block you can implement multiple logger implementations for different inner services. The one around 6:35 is for services that deal with hyper Requests, but what if you don't have HTTP and still want to log something, e.g with gRPC or on Lambda? That's a new impl for different trait bounds. That's how you can keep one service but adapt. The best thing: You can be as generic or as specific as you want to be. Defining a trait bound in the struct will limit you in that regard.
@cruintention
@cruintention Жыл бұрын
@sbaumg but if you have a generic trait impl you can't have any others, right?
@rumplstiltztinkerstein
@rumplstiltztinkerstein 2 жыл бұрын
Very interesting!
@Staninna
@Staninna Жыл бұрын
Thank you, I think I got it down.
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
UFC 287 : Перейра VS Адесанья 2
6:02
Setanta Sports UFC
Рет қаралды 486 М.
She wanted to set me up #shorts by Tsuriki Show
0:56
Tsuriki Show
Рет қаралды 8 МЛН
Rust Before Main - Ryan Levick - Rust Linz, July 2022
31:34
rustls - TLS in Rust
34:39
Rust Nederland (RustNL)
Рет қаралды 5 М.
Tonic makes gRPC in Rust stupidly simple
19:08
Dreams of Code
Рет қаралды 54 М.
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН