pub fn check_owns_write_lock(&self, port_name: &String, sub_id: &String) -> Result<()> {
    match self.write_locks.get(port_name) {
      None => Err(ErrorKind::NeedWriteLock(port_name.to_string()).into()),
      Some(sid) => {
        if sid != sub_id {
          Err(ErrorKind::AlreadyWriteLocked(port_name.to_string()).into())
        } else {
          Ok(())
        }
      }
    }
  }
/// Check if sub id has write lock on this port, if it doesn't,
/// return error
Check if sub id has write lock on this port, if it doesn't,
return error
Check if sub id has write lock on this port if it doesn ' t return error
pub fn check_owns_write_lock(&self, port_name: &String, sub_id: &String) -> Result<()> {
    match self.write_locks.get(port_name) {
      None => Err(ErrorKind::NeedWriteLock(port_name.to_string()).into()),
      Some(sid) => {
        if sid != sub_id {
          Err(ErrorKind::AlreadyWriteLocked(port_name.to_string()).into())
        } else {
          Ok(())
        }
      }
    }
  }
pub fn check_owns_write_lock ( & self , port_name : & String , sub_id : & String ) -> Result < ( ) > { match self . write_locks . get ( port_name ) { None => Err ( ErrorKind :: NeedWriteLock ( port_name . to_string ( ) ) . into ( ) ) , Some ( sid ) => { if sid != sub_id { Err ( ErrorKind :: AlreadyWriteLocked ( port_name . to_string ( ) ) . into ( ) ) } else { Ok ( ( ) ) } } } }
Check if sub id has write lock on this port, if it doesn't,
return error
Check if sub id has write lock on this port if it doesn ' t return error
&self
port_name
&String
sub_id
&String
&self
port_name
&String
sub_id
&String