You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: session.rs
    path of file: ./repos/CYFS/src/component/cyfs-lib/src/ws
    
    the code of the file until where you have to start completion: use super::packet::*;
use super::request::*;
use async_std::future::TimeoutError;
use cyfs_base::{BuckyError, BuckyErrorCode, BuckyResult};
use cyfs_debug::Mutex;

use async_std::channel::{Rece
    
    pub async fn post_msg(&self, msg: Vec<u8>) -> BuckyResult<()> {
        let tx = self.tx.lock().unwrap().clone();
        if let Some(tx) = tx {
            let msg = Message::binary(msg);
            if let Err(e) = tx.send(msg).await {
                let msg = format!("session tx already closed! sid={}, {}", self.sid, e);
                warn!("{}", msg);
                Err(BuckyError::new(BuckyErrorCode::NotConnected, msg))
            } else {
                Ok(())
            }
        } else {
            // session is aborted, should ignore
            let msg = format!("session tx not exists! sid={}", self.sid);
            warn!("{}", msg);

            Err(BuckyError::new(BuckyErrorCode::NotConnected, msg))
        }
    }