EnvFrame

Trait EnvFrame 

Source
pub trait EnvFrame {
    // Required methods
    fn marshal(val: Vec<Hash>) -> String;
    fn parse(content: String) -> Vec<Hash>;
    fn new(name: String) -> Env;
    fn get(&self, k: &str) -> Wrapper;
    fn get_debug(self) -> Vec<Hash>;
    fn set(&mut self, k: &str, v: Hash);
    fn debug(self);
    fn upload(path: &str, pairs: Vec<Hash>) -> Env;
    fn global_env(&mut self);
    fn get_local(&self, k: &str) -> Wrapper;
    fn get_global(&self, k: &str) -> Wrapper;
}
Expand description

Using this trait you can extend the behavior of Env struct

§Example

use rust_env::{EnvFrame, Hash};

struct MyEnv {
    data: Vec<Hash>,
     global: Vec<Hash>,
     path: String
}

impl EnvFrame for MyEnv {
    //write your code
}

Required Methods§

Source

fn marshal(val: Vec<Hash>) -> String

Source

fn parse(content: String) -> Vec<Hash>

Source

fn new(name: String) -> Env

Source

fn get(&self, k: &str) -> Wrapper

Source

fn get_debug(self) -> Vec<Hash>

Source

fn set(&mut self, k: &str, v: Hash)

Source

fn debug(self)

Source

fn upload(path: &str, pairs: Vec<Hash>) -> Env

Source

fn global_env(&mut self)

Source

fn get_local(&self, k: &str) -> Wrapper

Source

fn get_global(&self, k: &str) -> Wrapper

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§