pub struct TCmlServer { /* private fields */ }Expand description
**** tokio多线程网站服务器 开始 *****
ipaddre ip和端口的映射
http_app_top ├ 路径路由方法 ├ 上传方式方式 ├ 传输信息 ├ 成员数量
ipaddnum ip地址的个数 http_setbpost 增加
pool_num 线程个数
top_templ dow_templ 变量头尾
overtext 结束关键字
Implementations§
Source§impl<'a> TCmlServer
impl<'a> TCmlServer
Sourcepub async fn new(ipadd: &'static str) -> TCmlServer
pub async fn new(ipadd: &'static str) -> TCmlServer
声明一个 web、websocket以及tcp服务。
§Examples
绑定一个ip和端口“0.0.0.0:8000“ 到当前服务,并且开启10个工作线程。
let mut cml = TCmlServer::new(“0.0.0.0:8000”).await;
设置ip以及post pnum 设置多个线程数
Sourcepub async fn templ(&'a mut self, top_template: String, down_template: String)
pub async fn templ(&'a mut self, top_template: String, down_template: String)
templ 中的string是为了在模板中识别变量替换文本用的关键字
例如 模板中的变量为 {$pname}
将用 templ(“{$”.to_string(),“}”.to_string()).await; 来处理这变量个分割数据方法
Trait Implementations§
Source§impl Clone for TCmlServer
impl Clone for TCmlServer
Source§fn clone(&self) -> TCmlServer
fn clone(&self) -> TCmlServer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TCmlServer
impl RefUnwindSafe for TCmlServer
impl Send for TCmlServer
impl Sync for TCmlServer
impl Unpin for TCmlServer
impl UnwindSafe for TCmlServer
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