Textlist

Struct Textlist 

Source
pub struct Textlist { /* private fields */ }
Expand description

引入模块 Textlist 队列数据存储结构体

Implementations§

Source§

impl Textlist

结构体Textlist方法

Source

pub fn new() -> Textlist

新建一个队列. 新建一个结构体 实现当前方法来创建新的队列.

§Examples
let mut dl: Textlist<T> = pubmsg::Textlist::new(); //新建一个队列
let d = dl.push(T); //括号内是写入内容
Source

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); //括号内是写入内容
Source

pub fn pop(&mut self) -> Option<[u8; 1024]>

输出当前队列第一个成员,并踢出队列 无传输数据

§Examples
let mut dl: Textlist<T> = pubmsg::Textlist::new();
let d = dl.pop();
Source

pub fn theone(&self, ind: usize) -> &[u8; 1024]

返回第一个队列成员,参数是id号。

§Examples
let mut dl: Textlist<T> = pubmsg::Textlist::new();
let d = dl.theone(0);
Source

pub fn is_empty(&self) -> bool

获取队列内容是否为空

let mut dl: Textlist<T> = pubmsg::Textlist::new();
if dl.is_empty{
    true
}else{
    false
}
Source

pub fn printdl(&self)

打印队列成员

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.