Crates.io | smart_house_lib |
lib.rs | smart_house_lib |
version | 0.3.2 |
source | src |
created_at | 2022-03-01 22:24:15.037571 |
updated_at | 2022-03-02 11:31:43.484691 |
description | It's a simple library to course OTUS Rust developer |
homepage | https://github.com/zhuravlevma |
repository | https://github.com/zhuravlevma/smart-house-lib |
max_upload_size | |
id | 541877 |
size | 39,932 |
[dependencies]
smart_house_lib = "0.3"
use smart_house_lib::{House};
let house = House::new("test_id".to_string(), "name".to_string());
use smart_house_lib::{House, Apartment};
let mut house = House::new("test_id".to_string(), "name".to_string());
house.add_apartment(Apartment::new("name".to_string()));
use smart_house_lib::{House, Apartment};
let mut house = House::new("test_id".to_string(), "name".to_string());
house.add_apartment(Apartment::new("name".to_string()));
house.remove_apartment("name".to_string());
use smart_house_lib::Apartment;
let apartment = Apartment::new("name".to_string());
use smart_house_lib::{Apartment, Device, Rosette};
let mut apartment = Apartment::new("name".to_string());
let device = Device::Rosette(Rosette::new("test".to_string(), "127.0.0.1:8080".to_string()));
apartment.add_device(device);
use smart_house_lib::{Apartment, Device, Rosette};
let mut apartment = Apartment::new("name".to_string());
let device = Device::Rosette(Rosette::new("test".to_string(), "127.0.0.1:8080".to_string()));
apartment.add_device(device);
apartment.remove_device("test".to_string());
use smart_house_lib::{Device, Rosette, Thermometer};
let thermometer = Device::Thermometer(Thermometer::new("name".to_string(), 23.0, "127.0.0.1:9091".to_string()));
let rosette = Device::Rosette(Rosette::new("name".to_string(), "127.0.0.1:8081".to_string()));
use smart_house_lib::Rosette;
let rosette = Rosette::new("name".to_string(), "127.0.0.1:9091".to_string());
use smart_house_lib::Thermometer;
let thermometer = Thermometer::new("name".to_string(), 23.0, "127.0.0.1:9091".to_string());
This project is licensed under the MIT license.