Comments (3)
Associated functions you are trying to access are deprecated since 0.12, maybe try using something like below code
use config::Config;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
pub struct ServerConfig {
pub host: String,
pub port: u16,
}
impl ServerConfig {
pub fn from_env() -> Self {
let _config = Config::builder()
.add_source(::config::Environment::default())
.build()
.unwrap();
let config: ServerConfig = _config.try_deserialize().unwrap();
config
}
}
[dependencies]
actix-web = "4"
config = "0.13.1"
Reference :
Config Doc https://docs.rs/config/0.13.1/config/index.html,
Official example from actix web https://github.com/actix/examples/blob/master/databases/postgres/src/main.rs
from actix-todo.
@VibhavSurve09 I'm referring the files in this repo:
https://github.com/nemesiscodex/actix-todo/blob/master/src/config.rs
https://github.com/nemesiscodex/actix-todo/blob/master/Cargo.toml
from actix-todo.
from actix-todo.
Related Issues (10)
- Login with Redis session storage
- Build error: cannot transmute between types
- Use quasar framework as Frontend HOT 1
- create database from framework HOT 3
- Unit tests HOT 1
- Improve error handling
- Docs needed
- Good demo, thank you! Can you add in JWT? Thanks. HOT 3
- I got this error when run "docker-compose up -d"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from actix-todo.