Rust Axum Full Course - Web Development (GitHub repo updated to Axum 0.7)

  Рет қаралды 163,819

Jeremy Chone

Jeremy Chone

Күн бұрын

Пікірлер: 333
@Iscream4j0y
@Iscream4j0y 6 ай бұрын
This is the only concrete evidence that I can find on the internet that actually shows people putting routes in something other than the main.rs file, THANK YOU
@bendo01
@bendo01 Жыл бұрын
Thank you very much for this tutorial, and how about upload files using axum?
@JeremyChone
@JeremyChone Жыл бұрын
Yes, file upload will be the topic of another video.
@bendo01
@bendo01 Жыл бұрын
@@JeremyChone thank you
@legends_assemble4938
@legends_assemble4938 10 ай бұрын
Hi There, It was a very comprehensive tutorial on axum, but I am stuck at one point, the function where we create mw_require_auth at timestamp: 41:43. I am getting an error *struct takes 0 generic arguments but 1 generic argument was supplied expected 0 generic arguments*. axum::middleware::Next does not any generic arguments, and when I following the video, this was giving me trouble.
@JeremyChone
@JeremyChone 10 ай бұрын
Which Axum version you use ?
@JeremyChone
@JeremyChone 10 ай бұрын
It seems you are using Axum 0.7, I am must finishing a video to show how to update. In the meantime, remove on text, and put Request from axum::body::Body, and you can remove the generic on the mw function. Should work.
@legends_assemble4938
@legends_assemble4938 10 ай бұрын
@@JeremyChone I am using 0.7
@JeremyChone
@JeremyChone 10 ай бұрын
@@legends_assemble4938 Awesome! I need to add a card/link to the 0.6 to 0.7 video. Eventually, I might update this course with Axum 0.7 and updated techniques.
@jamiecha
@jamiecha Жыл бұрын
Amazing tutorials. Good work! I would love to buy you a coffee if you have an account at Buy Me a Coffee
@JeremyChone
@JeremyChone Жыл бұрын
Thanks a lot for the nice feedback. Somehow, I got denied by Google AdSense, so I am focusing on my Patreon page instead: patreon.com/jeremychone.
@Singhrager
@Singhrager 11 ай бұрын
Hi Jeremy, great tutorial. I have one suggestion: it would be helpful if, at the start of each step, you stated more explicitly what you want to achieve by the end of the step. You do this to some extent, but sometimes things only make sense in hindsight. Again, great tutorial!
@JeremyChone
@JeremyChone 11 ай бұрын
Good feedback, I will keep that in mind.
@WIRED93
@WIRED93 7 ай бұрын
as a person who did few hundred apis in different languages and peeking into rust, i have to say this is top notch, up to the point, no bs tutorial covering exactly the things i was curious about, amazing work! thanks
@mixedproduce9787
@mixedproduce9787 6 ай бұрын
+100
@enriquemarin8842
@enriquemarin8842 Жыл бұрын
The work you do to teach us Rust with good practices is incredible. Thank you very much Jeremy.👍👌
@AbdulWahab-ev2ct
@AbdulWahab-ev2ct Жыл бұрын
GOAT OF ALL RUST CHANNELS OUT THERE ❤
@plepur-t8o
@plepur-t8o Жыл бұрын
Great video, one hour long, will take me 7-8 hours to digest.
@eviber5315
@eviber5315 Жыл бұрын
Feeling really lucky to see this went out just as I decided to learn how to use Axum, especially with this level of quality! It's all very new to me but your explanations are perfectly clear and concise. Thanks a lot!
@chris3079
@chris3079 Жыл бұрын
the quality of the production of this video is A++
@ciloriveros
@ciloriveros 5 ай бұрын
Thank you so much!! I'm just learning Rust, comming from scala, and this kind of resources is hard to find there.
@meiruwo
@meiruwo Жыл бұрын
Incredible tutorial. I am coming from the embedded world of C with a tiny bit of Rust experience, so the Rust things are a bit more familiar to me than the web development things. As I am going through this tutorial (and the follow-along), I am starting to really understand the intricacies of the backend. It is so clear that you have put tons of effort into preparation -- when I rewind and watch over, it's not because your explanations are confusing, but because you have managed to distill a lot of knowledge into a little bit of time! Instant subscribe here, this is amazing stuff.
@JeremyChone
@JeremyChone Жыл бұрын
Great, thank you for the detailed feedback. I'd appreciate your feedback on the web-app production coding session as well-it's 3 hours and 50 minutes long, so take your time. I'm also working on the second episode of the web-app production coding series, which should be informative too.
@vpetryniak
@vpetryniak 11 ай бұрын
Excellent!! 🔥🔥🔥 But also very simple and primitive to be honest:) Would be very interesting to see building chat server with Axum and WebSockets
@JeremyChone
@JeremyChone 11 ай бұрын
Yes, it's intentionally designed to be primitive. You can refer to the follow-up video on web-app production coding; it marks the beginning of an actual app. For more details, visit: rust10x.com/web-app More to come…
@roaringtwentiesstudio
@roaringtwentiesstudio Жыл бұрын
Thank you so much for this great tutorial. The teaching pace is quite fast and it was no piece of cake to understand all the methods you use as a rust noob (I've only read "the book", so sometimes, I was wondering "why does he uses as_ref() instead of the borrow checker, etc.)), but it was very interesting and informative. Big up to you!
@sampathsris
@sampathsris 2 күн бұрын
One problem you might face if you decide to implement login in a different route (e.g. "/auth/login" instead of "/api/login"): Make sure to set the auth cookie's path to "/".
@JeremyChone
@JeremyChone 2 күн бұрын
@@sampathsris yes, very important to set the path to /. Something I forgot to mention in this video.
@ChasingShadowsz
@ChasingShadowsz Жыл бұрын
Fantastic video Jeremy. I learned so much in this video, thank you 🙏🙏🙏. One small tip: you can use ULIDs instead of UUIDs to get timestamped and sortable IDs, which are certainly useful when using IDs inside logs!
@JeremyChone
@JeremyChone Жыл бұрын
Thanks for the kind words! Also, thank you for the note about ULIDs; they can indeed be used. In our case, we prefer timestamps (UTC ISO8601) and UUIDs because their conversions back and forth to numbers are well-known and widely supported. For log analytics, having these two as unsigned numbers can make a significant difference when querying large data sets (e.g., with dataframe tools).
@flyingsquirrel3271
@flyingsquirrel3271 Жыл бұрын
12:58 This seems to be currently broken in the latest axum version. At least for me this fails at runtime due to a false assertion in axum code (version 0.6.15), so I'm pretty sure, it's a bug. I tried axum 0.6.0 and it just worked, even without wrapping "SaveDir.." into "get_service". Edit: 0.6.12 seems to be the latest version where it works. In all versions newer than that, it fails.
@JeremyChone
@JeremyChone Жыл бұрын
Yes, see comment in the description. There was a bug introduced in `0.6.15`. In the cargo.toml put a `=0.6.12` for now. Here is the Axum ticket I filed: github.com/tokio-rs/axum/issues/1931, should be released soon.
@flyingsquirrel3271
@flyingsquirrel3271 Жыл бұрын
@@JeremyChone Haha okay thanks, I guess I should have read the description before searching the error myself. Maybe you could add some kind of annotation to the video at that timestamp (If that's easily possible with youtube)? That would probably save a lot of people some time ;-)
@JeremyChone
@JeremyChone Жыл бұрын
This would be a Link Card, but unfortunately, I can't add them. To do so, you need to be part of the KZbin Partner Program. However, for some strange reason, Google AdSense revoked my AdSense account, which removed me from the YPP. It's a bummer, as I didn't realize I would lose this feature.
@PeterFaria
@PeterFaria 11 ай бұрын
Regarding the delete implementation in 'CRUD - REST API', I’ve often found it easier to consume from the client if the server returns '204 NoContent', even if the item isn’t found. This makes the call idempotent, which allows the client the ability to retry in case of the prior call failing for any number of reasons. 32:39
@spirosmakris7847
@spirosmakris7847 Жыл бұрын
Been waiting for this! Thank you!
@alonelyproducer663
@alonelyproducer663 Жыл бұрын
I have been waiting for a tutorial from axum for so long. Thank you very much! Keep up the good work! :)
@timvermeulen4024
@timvermeulen4024 Жыл бұрын
Thanks for this video! I'm really digging the casual code-along style combined with really excellent preparation from your side, it's clear in everything you say that you deeply understand the subject matter.
@Lopolo28
@Lopolo28 Жыл бұрын
Hi. I have question. I cannot run cargo watch -q -c -w tests/ -x "test quick_dev -- --nocapture" because file.exe is already blocked by first terminal and it cannot rebuild it. Is there any option how to overcome this ? Thank you for your help
@JeremyChone
@JeremyChone Жыл бұрын
Yes, I heard this and did not hear about a solution. I am on Mac. Hope a windows user can give some tip here.
@JeremyChone
@JeremyChone Жыл бұрын
Hey, I think we've found the solution. Move `quick_dev.rs` to the `examples` folder, rename the function to `#[tokio::main]`, and it should allow you to do the following: - In Terminal 1: `cargo watch -q -c -w src/ -x run` - In Terminal 2: `cargo watch -q -c -w examples/ -x 'run --example quick_dev'`
@mumk
@mumk Жыл бұрын
I am having the same issue here
@mumk
@mumk Жыл бұрын
@@JeremyChone Thanks for the follow up, appreciate it, it works but without the test report, but it's better than not being able to compiled, cheers
@JeremyChone
@JeremyChone Жыл бұрын
​@@mumk Yes, and actually, the quick_dev is not about tests or test reports. So, it's better this way. In the next video, we will use tests, but for real unit tests. Everything will fall into place.
@peschu3659
@peschu3659 10 ай бұрын
Very Good Video, Thanks a lot for this. :) At about 1 hour, the pace got a bit too fast for me. But it definetely helped me in understand rust and axum etc.
@JeremyChone
@JeremyChone 10 ай бұрын
Thanks for the kind words. Yes, sometimes the editing might be too fast. I'll make sure to keep it in check for the next ones. Feel free to check out the latest videos about production coding. Here is the playlist: kzbin.info/aero/PL7r-PXl6ZPcCTTxjmsb9bFZB9i01fAtI7
@gaylonalfano
@gaylonalfano 11 ай бұрын
Absolutely stellar content! Can't hit the like button hard enough. For others new to Axum or looking further into the details of how it works, I'd highly recommend watching Jon Gjengset's breakdown on Axum: kzbin.info/www/bejne/jZ_FkKFrjtCnhZo
@JeremyChone
@JeremyChone 11 ай бұрын
Yes, Jon’s video is awesome to understand the inner working of Axum.
@ethanh20009
@ethanh20009 7 ай бұрын
I cannot even express how good this content is. Thank you! Can't believe this is free.
@maxxue5997
@maxxue5997 Жыл бұрын
Really amazing tutorial : D. Was wondering if you could elaborate on the model controller architecture you used and what it's called? Is it a derivation of MVC?
@JeremyChone
@JeremyChone Жыл бұрын
Thank you. Your timing is great, as I am currently constructing the follow-up course, which focuses on best practices for production code. We'll be dividing the ModelManager (which maintains the model-related application states, such as db_pool) and the ModelController, drawing inspiration from the Data Access Object (DAO) pattern. In a project management data model, for instance, you might have: A ProjectBmc (Backend Model Controller) that handles Create, Read, Update, and Delete (CRUD) operations, and possibly more, for Project entities. Similarly, a TaskBmc would manage the CRUD operations, and potentially additional ones, for Task entities. This approach gives you complete control over the data structures and access methods in your Application Domain, while still allowing for code reuse and normalization. Next course is schedule for June 4th.
@maxxue5997
@maxxue5997 Жыл бұрын
@@JeremyChone Sounds amazing. Can't wait. Thank you :))
@emanueley8410
@emanueley8410 9 ай бұрын
I've been following along this awesome course and the first time I stumbled was at 54:35 where you say "and now we just do a 'ctx-question mark'." It seemed weird because ctx isn't passed anywhere, no method is called on it and as I am new to Rust it took me moment to understand what that means. A Rust-beginner-friendly comment would be that this has the effect of evaluating whether ctx (which is a Result) contains an error and raising ie, propagating it.
@JeremyChone
@JeremyChone 9 ай бұрын
Very good point. You're right, a bit more explanation on this one would have been useful.
@emanueley8410
@emanueley8410 9 ай бұрын
@@JeremyChone and by the way, your videos are really excellent and fantastically crammed full of well thought details. Merci beaucoup pour ces vidéos! Oh, and I have of course subscribed and joined your patreon ;)
@JeremyChone
@JeremyChone 9 ай бұрын
Hi, thank you for the note and joined the patreon. This makes a big difference. New cool video coming about building a AI Buddy command line with OpenAI assistant API.
@froop2393
@froop2393 Жыл бұрын
Omg... The amount of useful information in this video is incredible!
@bombrman1994
@bombrman1994 6 ай бұрын
it took me like 2 days almost following you line by line, I will have to revisit the code now by myself. This was lots of info in one video considering im totally new in rust let alone its eco-system pakcges etc
@SkegAudio
@SkegAudio Жыл бұрын
Wow, the timing! How did you know I needed this right now?
@AlexYuhno
@AlexYuhno Жыл бұрын
Awesome! Thank you for tutorial
@boh419
@boh419 Жыл бұрын
great tutorial like always ,keep up the good work and thank you.
@midewestmond9442
@midewestmond9442 Жыл бұрын
❤❤❤❤❤❤❤❤ raw content with so much to learn. I have axum servers, but the best practices you show in your videos make you unique
@pb3030
@pb3030 Жыл бұрын
This is a very well done tutorial. Actually useful and well beyond the standard "hello world" nonsense you usually see. This guy does very good videos.
@pb3030
@pb3030 Жыл бұрын
I have a question / thought. By making the context extractor clone the context result you force the crate's Error type to implement Clone. This cascades into an issue with a real world app using 3rd party db's like sqlx. Because we would probably want to use thiserror and #[from] to convert sqlx errors into your crate's custom error type. If you use several external libraries and want to convert several external errors this can be a headache. I handled by implementing From and using a String as the error date.
@flyingsquirrel3271
@flyingsquirrel3271 Жыл бұрын
Thank you so much, this is exactly what I was looking for! :D
@Rustby
@Rustby Жыл бұрын
Perfect tutorial Jeremy! Happy Coding 🎉
@christianmuriel8918
@christianmuriel8918 Жыл бұрын
This tutorial is fantastic, you are the best
@iHunYT
@iHunYT Жыл бұрын
Thanks, amazing lesson. Waiting for the next parts
@sentou31
@sentou31 Жыл бұрын
I just picked up learning rust again and this video was quiet a summary of a lot of rust features I had forgotten already. Great work!
@Parker8752
@Parker8752 11 ай бұрын
All my rust webdev thus far has been messing around with rocket - this does feel significantly lower level (rocket feels closer to a rails experience), but this does look interesting.
@GregFurmanek
@GregFurmanek Жыл бұрын
Great content, thank you. I am quite impressed at your presentation technique and how your editor and terminal orchestration works well together. Are those special tools you are using or is this just clever video editing? Also, what editor are you using? The multi line editing seems like a neat feature.
@JeremyChone
@JeremyChone Жыл бұрын
Thanks for the kind words. I am using VSCode with Google Material theme. ScreenBrush for the line Davinci Resolve for the editing. And a custom Mac screencapture CLI wrapper. Unfortunately, no magic tools, a lot of editing.
@GregFurmanek
@GregFurmanek Жыл бұрын
@@JeremyChone Nicely done.
@JeremyChone
@JeremyChone 9 ай бұрын
Btw, I finally took some time to create the Rust10x VSCode Extension and a webpage with information about my VSCode setup. Everything can be found here: rust10x.com/vscode
@noku9789
@noku9789 Жыл бұрын
Thank you, great tutorial as always
@manojperiathambi7520
@manojperiathambi7520 Жыл бұрын
Hi, I'm not able to run server and quick-dev on the project side by side. It is giving error Access denied on the exe program of the project.
@JeremyChone
@JeremyChone Жыл бұрын
Yes, there seems to be a problem on Windows. You can move the quick_dev.rs in examples/ and run it from there (cargo watch -x "run --example quick_dev")
@manojperiathambi7520
@manojperiathambi7520 Жыл бұрын
Thank you for the suggestion and the course. Looking forward to learn more from you. @@JeremyChone
@grifferz
@grifferz 5 ай бұрын
This has been amazingly helpful, thank you. I really appreciate how you have taken the many concepts that are documented but only to a shallow simplistic level, and shown how to put them together, in a way that is more similar to how you'd want in production. It bridges a knowledge gap that is very real for me.
@jordyalejandro787
@jordyalejandro787 Жыл бұрын
Very good course, greetings from Ecuador
@oyewodayo
@oyewodayo Жыл бұрын
This is fantastic. Thank you for this. But could you do a video of Axum with surreal db.
@JeremyChone
@JeremyChone Жыл бұрын
Good point. This might come later. In the next tutorial, we will refactor the model layer while still using a mock-store (a better one). This will demonstrate how to implement multi-scheme password encryption, secure web tokens, and RPC (JSON-RPC).
@ItaloMaiaTM
@ItaloMaiaTM 11 ай бұрын
On the "Path Param" part, you could have shown as well how to use HelloParams with hello2. For me it was very intuitive, even thought your example is also nice (and probably should be kept). Really enjoying this vid!
@eli1882
@eli1882 10 ай бұрын
I smoke massive chones
@th3librarian147
@th3librarian147 Жыл бұрын
The right tutorial at the right time. I'm even watching for the second time 👍👍
@JeremyChone
@JeremyChone Жыл бұрын
Awesome!!! Thanks for the note.
@jfbarbosaboro
@jfbarbosaboro 7 ай бұрын
I just can't believe this is FREE content. Thank you so much for sharing your knowledge!
@David-wb4re
@David-wb4re Жыл бұрын
Hello Jeremy. Thank you for your videos about axum, I enjoyed watching them. When I started testing the code myself, I became curious about what was in req.extencions, but I couldn’t do it. Do you have any ideas on how this can be done? here is an example of what I would like to receive pub async fn mw_ctx_resolver( cookies: Cookies, mut req: Request, next: Next, ) -> Result { .... println!("{req.extensions.len():?}") // 6 // output 6 records for (key, value) in req.extensions.iter() { println!("Key: {:?}, Value: {:?}", key, value); } }
@JeremyChone
@JeremyChone Жыл бұрын
Ah, `Extensions` is a wrapper around "AnyMap," which is a HashMap of `TypeId`. Axum uses the `http` implementation of `Extensions` (I believe there are a couple implementation of "TypeMap"). You can find find the http/axum one here: github.com/hyperium/http/blob/master/src/extensions.rs I do not think it implements `Iter` or `IntoIter`, which is why you cannot use a for loop on it.
@el_carbonara
@el_carbonara 8 ай бұрын
cant thank you enough for these vids, you have amazing skills!
@jvstbecause
@jvstbecause 7 ай бұрын
You make your videos with a very good quality, 15 Minutes in and I am subscribed :)
@sinaebr7337
@sinaebr7337 Жыл бұрын
before staring video i want to say thanks wish best for you ❤
@kaporos
@kaporos Жыл бұрын
Hello ! Thanks for this amazing vid too :) I also have a question with errors i got while implementing my own version of your vid :) Is there anyway for the error type to get a " from implementation from all types implementing errors " (well, its not clear, lemme explain ahah) I like to use ? operator, but it often does not work because MyError does not implement From (like parsing a number for example) and i dont want to have MyError filled with `ParseError(#[from] std::num::ParseIntError)`/... because they are not project's scoped. I'd like to get somewhat default but still allowing me to see original error Is there anyway to achieve this ?
@JeremyChone
@JeremyChone Жыл бұрын
Did you try anyhow? It does kind of what you want I think.
@vietle1479
@vietle1479 Жыл бұрын
Even it's hard for me to keep up with video learning because my english not good enough but I still love his format of tutorial, that's rarely seen on vid turtorial flooding us everyday. Keep up the good work and thank you.
@christopherugbomah8747
@christopherugbomah8747 Жыл бұрын
This is such an awesome "quickstart" guide for newbies into rust like me. Question: how do you handle token claims validation (possibly in the middleware) assuming the token is not stored in a db? To what do we compare the token (or the claims it contains) stored in a cookie at log-in? I suspect I might be missing something though.
@JeremyChone
@JeremyChone Жыл бұрын
Next video, June 11, will show full login, pwd encryption, token encryption/validation.
@christopherugbomah8747
@christopherugbomah8747 Жыл бұрын
@@JeremyChone Thanks for your kind reply the work you do!
@data-center-project
@data-center-project 10 ай бұрын
Thanks for the course! 8:40 It's a good idea 🙂 Like!!!
@thanhliemtu8071
@thanhliemtu8071 8 ай бұрын
Hi, thanks for the great video. One question tho, how come the Ctx extractor gets called twice between mw_ctx_resolver and mw_require_auth after we implement the server log line? I know one of the calls is to extract the Ctx for mw_require_auth, but what about the other one?
@JeremyChone
@JeremyChone 8 ай бұрын
The mw_ctx_resolver resolves the CTX (essentially performing the authentication) and then stores it in req.extensions, so it doesn't need to be computed again. The mw_ctx_require is an optional middleware that ensures anything following it has a CTX, even if they don't explicitly require it. This is currently just an optional safeguard because downstream handlers that request CTX will fail if there isn't one. However, it's good to have.
@sunhsiang6644
@sunhsiang6644 Жыл бұрын
OMG the best video of Axum👍🏻👍🏻
@Whiteblooder
@Whiteblooder 9 ай бұрын
Thank you for a great resource Jeremy! Question: how do you open this "Quick fix" panel for quick imports?
@JeremyChone
@JeremyChone 9 ай бұрын
I think they comes with VSCode and Rust analyzer. Then, cmd + .
@TheValithan
@TheValithan Жыл бұрын
Jeremy ty so much. I am having problem with test environment. Whenever I use cargo watch for tests/ it says, it cant remove the exe file of server.(failed to remove file.....) Why does such a thing happen?
@JeremyChone
@JeremyChone Жыл бұрын
I think this is a windows thing. Try to move the quick_dev.ts as an examples/ and run it as cargo run -example quick_dev Or cargo watch -q -c -w examples/ -x “run -example quick_dev”
@irlshrek
@irlshrek Жыл бұрын
also, whats that debugprint tool that youre using?
@JeremyChone
@JeremyChone Жыл бұрын
Ho, just println! with the ->> personal notation. No special tools. Next video, we will be using tracing for those. However, I still use the "debug print" in between commits to debug quickly. Tracing gets committed and for things that might be useful in production.
@gusjoagomez
@gusjoagomez 7 ай бұрын
Great!!!!!!
@AlwaysStaringSkyward
@AlwaysStaringSkyward 11 ай бұрын
Jeremy, this is gold! Thank you!
@prashlovessamosa
@prashlovessamosa Жыл бұрын
Thank God I found you looking forward to learn awesome stuff from you.
@jorgeosorio1613
@jorgeosorio1613 Жыл бұрын
Hi jeremy, for next videos you could consider the server sent events implementation with axum, I had problems with the "try_stream!" macro of async_stream when passing custom data to it. Greetings from Colombia, your videos are very good.
@JeremyChone
@JeremyChone Жыл бұрын
Ha, that's a good suggestion. Might not be in the next one but at some point. Question: Is your use case for Video or Audio streaming?
@jorgeosorio1613
@jorgeosorio1613 Жыл бұрын
​@@JeremyChone No, actually it was a simpler project. I was using it to display real-time CPU and graphics card information with a browser interface. But you just gave me more ideas for other projects.
@JeremyChone
@JeremyChone Жыл бұрын
@@jorgeosorio1613 ha, cool, yes, make sense. By the way, for files in the .mp4 or .mp3/.wav/... formats, I recommend using a cloud CDN such as AWS CloudFront to S3. This approach allows you to sign the URL to ensure security and keep the app server out of the way, which is always preferable. However, when the data is being dynamically processed, you must stream it from the app server.
@jocketf3083
@jocketf3083 11 ай бұрын
Excellent tutorial! Thank You!
@BOOGLE020
@BOOGLE020 Жыл бұрын
subscribed! Appreciate the lesson. Is it possible to have a tutorial on deploying Rust apps to a web server? That would make the lesson "complete" 😊
@JeremyChone
@JeremyChone Жыл бұрын
Thanks! The next video will be about leveling up and building the Rust Axum base code for a real application, featuring password encryption (multi-scheme), secure tokens, PostgreSQL/SQLx, and a scalable Model layer. So, not the deployment to cloud, which will come later with Kubernetes when we will learn how to do multi-service cloud app.
@BOOGLE020
@BOOGLE020 Жыл бұрын
@@JeremyChone thank you! Looking forward for it. I'm a newbie in Rust and somehow deploying to a cloud is a sort of "hello world" for me just to get the feel on how I can use it in a production environment.
@ajays6393
@ajays6393 3 ай бұрын
Thank you so much or this for this brilliant tutorial!
@fabricedujardin1037
@fabricedujardin1037 Жыл бұрын
Great content 🎉
@aleksandrbakhmach9810
@aleksandrbakhmach9810 10 ай бұрын
Awesome man, great thank u !
@Mokodokococo
@Mokodokococo 9 ай бұрын
Tu es mon hero. C'est vraiment trop bien tes videos. Merci
@TON-vz3pe
@TON-vz3pe 9 ай бұрын
Its a pain to send a not Send type to the routers from the main program
@mannycalavera121
@mannycalavera121 Жыл бұрын
Thanks for putting putting this together, really appreciate it. I'm struggling with understanding these frameworks and this helps immensely
@craigcook9715
@craigcook9715 24 күн бұрын
I'm new to learning Rust. Does Axum translate well into having a GraphQL (not REST) backend? I definitely strongly prefer GraphQL backends.
@JeremyChone
@JeremyChone 24 күн бұрын
Axum is one level below the given protocol. You can use REST, JSON-RPC, GraphQL, or even gRPC with Tonic. This is the approach I prefer: a web framework that does not try to do too much and stays at its level. Axum is awesome.
@polares8187
@polares8187 Жыл бұрын
Thank you for this so much. It is complex but you make it understandable. Superb Rust content 😊😊
@coryjohnson2914
@coryjohnson2914 Жыл бұрын
Great Video! I am wondering how to utiliize snippets like "region" and function definitions that you are so quickly creating? Do you have custom Snippets and hotkeys for VS Code or just utilizing what's in place from rust-analyzer plugin?
@JeremyChone
@JeremyChone Жыл бұрын
Just a VSCode Snippet that I bound to 'ctr+c' "comment-section": { "prefix": "cc", "body": [ "// region: --- ${1:Section}", "${2}$TM_SELECTED_TEXT", "// endregion: --- ${1:Section}" ], "description": "Comment Section" },
@JeremyChone
@JeremyChone 9 ай бұрын
Btw, I finally took some time to create the Rust10x VSCode Extension and a webpage with information about my VSCode setup. Everything can be found here: rust10x.com/vscode
@sebastianjaranilsson7116
@sebastianjaranilsson7116 10 ай бұрын
amazing course Jeremy!!
@gustav_spin
@gustav_spin Жыл бұрын
Thank you for this so much!
@СерегаБ-б3н
@СерегаБ-б3н Жыл бұрын
Thank you very much for the video! How do you do quick #region?
@JeremyChone
@JeremyChone Жыл бұрын
Code snippet "comment-section": { "prefix": "cc", "body": [ "// region: --- ${1:Section}", "${2}$TM_SELECTED_TEXT", "// endregion: --- ${1:Section}" ], "description": "Comment Section" },
@Adorha
@Adorha Жыл бұрын
Very helpful, thanks a lot for your amazing work 🙏
@Kisme-e9f
@Kisme-e9f 11 ай бұрын
websocket with rust ans axum pleaseeeeeeeeeeeeee😍
@Enriquecav
@Enriquecav Жыл бұрын
Thank you Jeremy for your great guides. I am learning so much from you, and your videos are SUPER well made
@s_e_t_z3248
@s_e_t_z3248 10 ай бұрын
I'm in the very beginning of the video writing the first test function but I'm getting an error with my #[tokio::test] and all of the subsequent uses of the "?" operator. Why could this be? the `?` operator can only be used in an async block that returns `Result` or `Option` (or another type that implements `FromResidual`) the trait `FromResidual` is not implemented for `()`
@JeremyChone
@JeremyChone 10 ай бұрын
Do you have -> Result in your test function returns ? I did not see this error.
@NetherFX
@NetherFX Жыл бұрын
Wonderful tutorial! Something im noticing is that the returning status code is not the same as error IntoResponse status code. For a failed login it should return 403 but it's returning 500, did I miss something?
@JeremyChone
@JeremyChone Жыл бұрын
Thanks for the kind words. It does send back a 403 Forbidden if the wrong login. (with the full final code). Here is how it works: - The impl IntoResponse for Error creates a placeholder for the real error. - The main_response_mapper will get the error and call the client_status_and_error, which will return the appropriate status code and send that back to the client. If you go to the quick_dev, and change the password on the login, you will see the login and tickets response with the following status: Status : 403 Forbidden Hope this helps. I just tested the code, and works as expected. Let me know if you have any further question.
@NetherFX
@NetherFX Жыл бұрын
@@JeremyChone Just pulled the repo and I didnt notice the "error_response.unwrap_or(res)" at the end 😅That makes a lot more sense, thank you!
@maxali6591
@maxali6591 Жыл бұрын
Do you will continue to create tutorial despite of the Rust new policy?
@JeremyChone
@JeremyChone Жыл бұрын
YES, unfettered. Here is my take. This Rust Foundation proposal was a big mishap on their part. As a result, it will either change or not apply to genuine educational creators like myself, even if I eventually decide to monetize some of my courses. Unfortunately, what they put up was so misguided, unnecessary, and counterproductive that it will have a lasting effect on the Rust Foundation brand. This is the unfortunate part. I hope other Rust entities can act right and fast and keep some credibility to rehabilitate the Rust Foundation to the community over time. (I will post more on this soon)
@maxali6591
@maxali6591 Жыл бұрын
@@JeremyChone OK, thanks I feel reassured. Waiting for it too, 😊. Keep going your content is really good.
@JeremyChone
@JeremyChone Жыл бұрын
Here is my take on the matter: twitter.com/jeremychone/status/1645952074893635584
@pranich
@pranich Жыл бұрын
Nice, it would have been nice to have a branch with the starting state so we follow along
@JeremyChone
@JeremyChone Жыл бұрын
Yes, I could do that. Will think about it for next full course.
@funkdefied1
@funkdefied1 Жыл бұрын
This video is a lofesaver
@ant1fact
@ant1fact Жыл бұрын
Omg that infobomb you dropped about .as_deref() around the 8 minute mark blew my mind! ❤
@abacaabaca8131
@abacaabaca8131 7 ай бұрын
What would be the best way to render a html file in the browser? At the moment, the file is converted as `String` type which then passed into `Html` object. All the html element is rendered correctly but not an image file. it sits in the img element under a element in the DOM hierarchy. One more thing why is that Axum doesn't print an error message by default if something fail. It is not Django, but perhaps we need to enable it? Tried debug build or release build still no error message being printed.
@JeremyChone
@JeremyChone 7 ай бұрын
Just return the Html(...) and then map the image link to their corresponding image router. Typically, we wire the filesystem middleware to take care of this.
@shecodeshk
@shecodeshk 11 ай бұрын
just started learning rust & watching your video! ive a question - at 4:33, i try to follow and run the command: cargo watch -q -c -w src/ -x run but it says no such command as 'watch' - anyone experience this?
@JeremyChone
@JeremyChone 11 ай бұрын
Ho, do a ‘cargo install cargo-watch’
@sakuraharun00
@sakuraharun00 9 ай бұрын
Hello, sir. We are using a mutex in asynchronous programming. Will it not create a deadlock if we await after locking, and another request comes in? Since we are working with a single main thread, the lock will not be able to unlock, and the request will not be able to process.
@JeremyChone
@JeremyChone 9 ай бұрын
First, I'm not certain if it's a single thread. By default, the `tokio::main` uses multiple threads to run its tasks.
@sakuraharun00
@sakuraharun00 9 ай бұрын
@@JeremyChone okay sir, thanks for the reply.
@JeremyChone
@JeremyChone 8 ай бұрын
​ @sakuraharun00 By the way, I mentioned that "tokio::main" is multithreaded by default, but actually, it requires the rt-multi-thread feature in the tokio dependency. But because we have the `features = ["full"]` then we had the multithread by default.
@AIExEy
@AIExEy 7 ай бұрын
You're awesome dude!
@flwi
@flwi Жыл бұрын
Great intro! Thanks a lot for putting in the effort to create this tutorial. I learned a lot and enjoyed the process!
@_-_-_-_-_-_-_-
@_-_-_-_-_-_-_- Жыл бұрын
This is amazing, thank you!
@meka4996
@meka4996 3 ай бұрын
Amazing man! Thank you.
@ise1153
@ise1153 Жыл бұрын
Thank you for this great tutorial. In this vedio, I wonder your vscode plugin setting, especially multi region annotation part..
@JeremyChone
@JeremyChone Жыл бұрын
I put some of my VSCode settings at: rust10x.com/vscode There is the comment-section there, and the key binding for it.
@JeremyChone
@JeremyChone 9 ай бұрын
BTW, I finally took some time to create the Rust10x VSCode Extension and a webpage with information about my VSCode setup. Everything can be found here: rust10x.com/vscode
@ise1153
@ise1153 9 ай бұрын
@@JeremyChone thx bro:)
@martinbecker1069
@martinbecker1069 Жыл бұрын
@Jeremy Chone Why do you not provide a means to set headers in your testing client?
@JeremyChone
@JeremyChone Жыл бұрын
That's a good question. Originally, I didn't aim to delve too deeply into rebuilding Reqwest on top of Reqwest. Instead, I focused more on "browser" use cases, where authentication is typically done with cookies. However, now I agree that it would be beneficial to broaden the scope and allow the setting of headers. The route I'm keen to avoid is the full reconstruction of a Reqwest API using the Reqwest library. My proposed approach is to expose an API like http_client.exec(reqwest_builder), perhaps coupled with some utilities for building these builders. This approach allows developers to use the simple httpc-test API/Prints, while simultaneously harnessing the full power of the Reqwest request builder. Does that make sense?
@martinbecker1069
@martinbecker1069 Жыл бұрын
@@JeremyChone Indeed
2 Cool Pull Requests for Rust Web App Blueprint
12:52
Jeremy Chone
Рет қаралды 3,4 М.
Rust Programming: The Ultimate Builder Pattern Tutorial
20:22
Jeremy Chone
Рет қаралды 39 М.
Офицер, я всё объясню
01:00
История одного вокалиста
Рет қаралды 4,1 МЛН
Electric Flying Bird with Hanging Wire Automatic for Ceiling Parrot
00:15
Full-Stack Web Apps with Rust and Leptos - Session 1 of 4
1:08:25
Training 4 Programmers
Рет қаралды 1,2 М.
Rust Error Handling - Best Practices
21:33
Jeremy Chone
Рет қаралды 21 М.
Why Rust is NOT a Passing Fad...
8:54
Travis Media
Рет қаралды 37 М.
I spent six months rewriting everything in Rust
15:11
chris biscardi
Рет қаралды 430 М.
Modern All Rust Stack - Dioxus, Axum, Warp, SurrealDB
24:02
Code to the Moon
Рет қаралды 65 М.
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 489 М.
API Conference 2023: Building Web APIs in Rust With Axum
42:18
Rainer Stropek
Рет қаралды 6 М.
Офицер, я всё объясню
01:00
История одного вокалиста
Рет қаралды 4,1 МЛН