Header menu logo FSharp.ATProto

Handle Module

Functions for creating, validating, and extracting data from Handle values.

Functions and values

Function or value Description

parse s

Full Usage: parse s

Parameters:
    s : string - A handle string in domain-name format (e.g. "my-handle.bsky.social"). Must be a valid hostname with at least two segments, each segment starting and ending with an alphanumeric character, and the TLD starting with a letter.

Returns: Result<Handle, string> Ok with a validated Handle, or Error with a message describing the validation failure. Validation failures include: null input, exceeding the 253-character limit, or invalid hostname syntax.

Parse and validate a handle string.

s : string

A handle string in domain-name format (e.g. "my-handle.bsky.social"). Must be a valid hostname with at least two segments, each segment starting and ending with an alphanumeric character, and the TLD starting with a letter.

Returns: Result<Handle, string>

Ok with a validated Handle, or Error with a message describing the validation failure. Validation failures include: null input, exceeding the 253-character limit, or invalid hostname syntax.

Example

 match Handle.parse "my-handle.bsky.social" with
 | Ok handle -> printfn "Valid: %s" (Handle.value handle)
 | Error e -> printfn "Invalid: %s" e
union case Result.Ok: ResultValue: 'T -> Result<'T,'TError>
val handle: obj
val printfn: format: Printf.TextWriterFormat<'T> -> 'T
union case Result.Error: ErrorValue: 'TError -> Result<'T,'TError>
val e: string

value arg1

Full Usage: value arg1

Parameters:
Returns: string The full handle string (e.g. "my-handle.bsky.social").

Extract the string representation of a handle.

arg0 : Handle
Returns: string

The full handle string (e.g. "my-handle.bsky.social").

Type something to start searching.