Pudu programming language
Menu
API reference

Std.Tls.withConnection

1 declaration

fn

withConnection: Str -> Int -> fn(Std.Tls.Secured) -> Result[T, Std.Tls.TlsError] -> Result[T, Std.Tls.TlsError]

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.

Back to Std.TlsSearch related declarations