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.
Rust Before Main - Ryan Levick - Rust Linz, July 2022
31:34
Who is More Stupid? #tiktok #sigmagirl #funny
0:27
CRAZY GREAPA
Рет қаралды 10 МЛН
Хаги Ваги говорит разными голосами
0:22
Фани Хани
Рет қаралды 2,2 МЛН
Creating a Chat Server with async Rust and Tokio
53:44
Manning Publications
Рет қаралды 14 М.
Intro to async/.await in Rust
13:57
Let's Get Rusty
Рет қаралды 93 М.
Tonic makes gRPC in Rust stupidly simple
19:08
Dreams of Code
Рет қаралды 54 М.