mardi 13 avril 2021

Application design in rust

I come from a Go background , and am trying to port an appliation from go to rust .I have never used rust before ,and I do find some of programing paradims to be a bit complicated ,but I am getting used to it. One of the most important features that go application had is the concept of a context. It is a top level struct which holds copies/pointers to anything that the application needs .

An example

https://github.com/cosmos/cosmos-sdk/blob/3ebf06ce0d9d04a1d94a769583fd0b58d2c63ec0/types/context.go#L16

And this is a very common design used in various go projects. I have been trying to find something similar being used in rust applications , but I cant seem to find that.

Is there a reason why this pattern is not used in rust , or have I just not found the right projects ?

Aucun commentaire:

Enregistrer un commentaire