possum/nsid
Types
Namespaced Identifiers (NSIDs) are used to reference Lexicon schemas for records, endpoints, and more. For example:
sh.tangled.repo.pull
└─────────────┘ └──┘
authority name
The basic structure of an NSID are a hostname in reverse domain-name order, followed by an additional name segment. The hostname part is called the domain authority, and the final segment is the name.
Documentation: Namespaced Identifiers
pub opaque type Nsid
pub type ParseError {
InvalidRegexPattern(pattern: String)
InvalidSyntax(value: String)
}
Constructors
-
InvalidRegexPattern(pattern: String)Regex failed to compile
-
InvalidSyntax(value: String)String does not have a valid NSID format
Values
pub fn parse(content: String) -> Result(Nsid, ParseError)
Parse a string into a valid Nsid type
If the value is not a valid string then an error is returned.
Examples
import possum/nsid
let string = "com.atproto.sync.getRecord."
let assert Ok(nsid) = nsid.parse(string)
See also: Nsid