pub struct Textlist { /* private fields */ }Expand description
引入模块 Textlist 队列数据存储结构体
Implementations§
Source§impl Textlist
结构体Textlist方法
impl Textlist
结构体Textlist方法
Sourcepub fn new() -> Textlist
pub fn new() -> Textlist
新建一个队列. 新建一个结构体 实现当前方法来创建新的队列.
§Examples
let mut dl: Textlist<T> = pubmsg::Textlist::new(); //新建一个队列
let d = dl.push(T); //括号内是写入内容Sourcepub fn push(&mut self, items: [u8; 1024])
pub fn push(&mut self, items: [u8; 1024])
Push a character onto the back of a queue. 写入一个数据到队列中
§Examples
let mut dl: Textlist<T> = pubmsg::Textlist::new();
let d = dl.push(T); //括号内是写入内容Sourcepub fn pop(&mut self) -> Option<[u8; 1024]>
pub fn pop(&mut self) -> Option<[u8; 1024]>
输出当前队列第一个成员,并踢出队列 无传输数据
§Examples
let mut dl: Textlist<T> = pubmsg::Textlist::new();
let d = dl.pop();Sourcepub fn theone(&self, ind: usize) -> &[u8; 1024]
pub fn theone(&self, ind: usize) -> &[u8; 1024]
返回第一个队列成员,参数是id号。
§Examples
let mut dl: Textlist<T> = pubmsg::Textlist::new();
let d = dl.theone(0);Auto Trait Implementations§
impl Freeze for Textlist
impl RefUnwindSafe for Textlist
impl Send for Textlist
impl Sync for Textlist
impl Unpin for Textlist
impl UnwindSafe for Textlist
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more