Skip to main content

ActUserVar

Trait ActUserVar 

Source
pub trait ActUserVar: Send + Sync {
    // Required method
    fn name(&self) -> String;

    // Provided method
    fn default_data(&self) -> Option<Vars> { ... }
}
Expand description

User var trait It can create user releated context data

§Example

  use acts::{ActUserVar, Vars, Result};
  #[derive(Clone)]
  pub struct TestModule;
  impl ActUserVar for TestModule {
    fn name(&self) -> String {
        "my_var".to_string()
    }
     
    fn default_data(&self) -> Option<Vars> {
        None
    }
  }

Required Methods§

Source

fn name(&self) -> String

global easier access name in js expression such as secrets.TOKEN, the secrets will be the name it will get the data by the name from task context

Provided Methods§

Source

fn default_data(&self) -> Option<Vars>

initialzie default data the data will be overridden by context vars

Implementors§