pub struct TcpIpStack;Implementations§
Source§impl TcpIpStack
impl TcpIpStack
pub const fn new() -> Self
pub fn web_get( &self, is_https: bool, host: &str, path: &str, ) -> Result<AppHttpResponse, TcpIpError>
Sourcepub fn web_post(
&self,
is_https: bool,
host: &str,
path: &str,
content_type: &str,
body: &[u8],
) -> Result<AppHttpResponse, TcpIpError>
pub fn web_post( &self, is_https: bool, host: &str, path: &str, content_type: &str, body: &[u8], ) -> Result<AppHttpResponse, TcpIpError>
is_https に応じて HTTPS(TLS) / HTTP の POST を振り分ける。 HTTPS フォーム送信が平文 HTTP に落ちてボディが届かない不具合を防ぐ。
pub fn web_get_binary( &self, is_https: bool, host: &str, path: &str, ) -> Result<Vec<u8>, TcpIpError>
Sourcepub fn web_request(
&self,
is_https: bool,
host: &str,
path: &str,
method: &str,
content_type: &str,
body: &[u8],
) -> Result<AppHttpResponse, TcpIpError>
pub fn web_request( &self, is_https: bool, host: &str, path: &str, method: &str, content_type: &str, body: &[u8], ) -> Result<AppHttpResponse, TcpIpError>
任意メソッド(GET/POST/PUT/DELETE/PATCH/HEAD 等)の HTTP/HTTPS リクエスト。 method は英大文字トークンへ正規化し、未知の文字は弾く(ヘッダインジェクション防止)。 is_https に応じて TLS 経路(tls::https_request)と平文経路(http_request_real)を振り分ける。
Trait Implementations§
Source§impl ApplicationLayerApi for TcpIpStack
impl ApplicationLayerApi for TcpIpStack
fn http_get( &self, host: &str, path: &str, ) -> Result<AppHttpResponse, TcpIpError>
fn https_get( &self, host: &str, path: &str, ) -> Result<AppHttpResponse, TcpIpError>
fn http_post( &self, host: &str, path: &str, content_type: &str, body: &[u8], ) -> Result<AppHttpResponse, TcpIpError>
Source§impl Default for TcpIpStack
impl Default for TcpIpStack
Source§impl InternetLayerApi for TcpIpStack
impl InternetLayerApi for TcpIpStack
Source§impl LinkLayerApi for TcpIpStack
impl LinkLayerApi for TcpIpStack
Source§impl TransportLayerApi for TcpIpStack
impl TransportLayerApi for TcpIpStack
fn tcp_connect( &self, remote_ip: [u8; 4], remote_port: u16, ) -> Result<u16, TcpIpError>
fn tcp_send(&self, local_port: u16, data: &[u8]) -> Result<(), TcpIpError>
fn tcp_recv( &self, local_port: u16, timeout_iters: usize, ) -> Result<Vec<u8>, TcpIpError>
fn tcp_close(&self, local_port: u16) -> Result<(), TcpIpError>
Auto Trait Implementations§
impl Freeze for TcpIpStack
impl RefUnwindSafe for TcpIpStack
impl Send for TcpIpStack
impl Sync for TcpIpStack
impl Unpin for TcpIpStack
impl UnsafeUnpin for TcpIpStack
impl UnwindSafe for TcpIpStack
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