Function juju::is_leader[][src]

pub fn is_leader() -> Result<bool, JujuError>

Returns true/false if this unit is the leader


Will return stderr as a String if the function fails to run


extern crate juju;
let leader = match juju::is_leader(){
  Ok(l) => l,
  Err(e) => {
    println!("Failed to run.  Error was {:?}", e);
if leader{
  println!("I am the leader!");
  println!("I am not the leader.  Maybe later I will be promoted");