Std.Net.withConnection
1 declaration
fn
withConnection: Str -> Int -> fn(Std.Net.Connection) -> Result[T, Std.Net.NetError] -> Result[T, Std.Net.NetError]This is a callable function.
What it does
Open a connection, hand it to an action, and close it however the action
ended. There is no close a caller can forget, because there is no close.
Read the signature
- The text after the name is the type checked by Pudu.
- Read arrows from left to right: inputs come first, and the final type is returned.
- Names inside [ ] are type arguments, such as the item type held by a collection.
- Result makes success and recoverable failure part of the function's type.
