pub enum ProtFrame {
Create(ProtCreate),
Close(ProtClose),
Data(ProtData),
Token(ProtToken),
Mapping(ProtMapping),
}
Expand description
协议相关之具体协议
Variants§
Create(ProtCreate)
收到新的Socket连接
Close(ProtClose)
收到旧的Socket连接关闭
Data(ProtData)
收到Socket的相关数据
Token(ProtToken)
收到Token的相关数据
Mapping(ProtMapping)
收到内网映射的相关消息
Implementations§
source§impl ProtFrame
impl ProtFrame
sourcepub fn parse<T: Buf>(header: ProtFrameHeader, buf: T) -> ProxyResult<ProtFrame>
pub fn parse<T: Buf>(header: ProtFrameHeader, buf: T) -> ProxyResult<ProtFrame>
把字节流转化成数据对象
pub fn new_create(sock_map: u64, domain: Option<String>) -> Self
pub fn new_close(sock_map: u64) -> Self
pub fn new_close_reason(sock_map: u64, reason: String) -> Self
pub fn new_data(sock_map: u64, data: Vec<u8>) -> Self
pub fn new_mapping(sock_map: u64, mappings: Vec<MappingConfig>) -> Self
pub fn new_token(username: String, password: String) -> Self
pub fn is_create(&self) -> bool
pub fn is_close(&self) -> bool
pub fn is_data(&self) -> bool
pub fn is_mapping(&self) -> bool
pub fn sock_map(&self) -> u64
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ProtFrame
impl Send for ProtFrame
impl Sync for ProtFrame
impl Unpin for ProtFrame
impl UnwindSafe for ProtFrame
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