rl_lang/docs/entries/stdlib/net/
tcp_set_nonblocking.rs1use crate::docs::entry::FnEntry;
2
3pub static TCP_SET_NONBLOCKING: FnEntry = FnEntry {
4 signature: "tcp_set_nonblocking(stream, flag)",
5 description: "toggles nonblocking mode; reads/writes return immediately with a `WouldBlock`-style error instead of blocking",
6 example: r#"
7get std::net::tcp_set_nonblocking
8
9result_unwrap(tcp_set_nonblocking(stream, true))"#,
10 expected_output: None,
11 returns: "Result[null]",
12 errors: Some("Err(string) if the mode can't be set"),
13 see_also: &["tcp_set_timeout"],
14 since: Some("v0.1.5"),
15};