Expand description
Social graph primitives for ASIMOV.
Use SocialHandle to associate an account handle with its platform,
SocialProperty to select account information, and FollowRelationship
to describe the direction of a follow relationship between accounts.
SocialLink recognizes URLs for profiles, relationships, and other social
resources, with fallible conversions to and from supported account handles.
SocialPlatform::handle parses an identifier on a selected platform.
URL parsers accept HTTP(S), an optional www. hostname prefix, and known host
aliases; formatted URLs use HTTPS without www..
Platform modules re-export their platform-specific handle types. Each module
and its corresponding SocialHandle variant require the matching platform
feature; all platform features are enabled by default.
FetchRequest and ListRequest share asimov-remote’s transport-independent
request types and options. The serde feature enables their JSON encoding
without an HTTP client; client enables SocialClient for HTTP execution.
Caching, filtering, and timing are configured on the requests and encoded
alongside pattern options in the JSON options object.
use asimov_social::{FetchRequest, ListRequest};
let fetch = FetchRequest::new("https://example.com/profile", Default::default());
let json = serde_json::to_string(&fetch).unwrap();
assert_eq!(serde_json::from_str::<FetchRequest>(&json).unwrap(), fetch);
let list: ListRequest = serde_json::from_str(
r#"{"url":"https://example.com/collection","options":{"limit":0}}"#,
).unwrap();
assert_eq!(list.options.limit, Some(0));Modules§
- facebook
facebook - Facebook-specific types, including account handles.
Re-exports the types from
known_types_facebook, includingFacebookHandle. - github
github - GitHub-specific types, including account handles.
Re-exports the types from
known_types_github, includingGithubHandle. - gravatar
gravatar - Gravatar-specific types, including account handles.
Re-exports the types from
known_types_gravatar, includingGravatarHandle. - instagram
instagram - Instagram-specific types, including account handles.
Re-exports the types from
known_types_instagram, includingInstagramHandle. - introco
introco - Intro.co-specific types, including account handles.
Re-exports the types from
known_types_introco, includingIntrocoHandle. - linkedin
linkedin - LinkedIn-specific types, including account handles.
Re-exports the types from
known_types_linkedin, includingLinkedinHandle. - localai
localai - Local.ai-specific types, including account handles.
Re-exports the types from
known_types_localai, includingLocalaiHandle. - luma
luma - Luma-specific types, including account handles.
Re-exports the types from
known_types_luma, includingLumaHandle. - telegram
telegram - Telegram-specific types, including account handles.
Re-exports the types from
known_types_telegram, includingTelegramHandle. - whatsapp
whatsapp - WhatsApp-specific types, including account handles.
Re-exports the types from
known_types_whatsapp, includingWhatsappHandle. - x
x - X-specific account handles, profiles, and list identifiers.
Re-exports
XHandlefromknown_types_xand providesXProfilefor handle-based account profiles andXListfor numeric list identifiers.
Structs§
- Bluesky
Handle bluesky - A Bluesky domain handle: ASCII DNS labels, at most 253 bytes, with an alphabetic TLD start. DIDs are profile selectors, not handles.
- Caching
Options - Cache freshness requests shared by fetcher and lister commands.
- Collection
Stub - A collection’s optional identifier and item count, without its contents.
- Discord
Handle discord - A Discord profile identifier: a nonzero decimal
u64snowflake, not a username. Leading zeroes are rejected. - Fetch
Request - Shared, transport-independent request for one or more social resources. An owned, transport-independent request to fetch resources.
- Fetch
Request Options - Shared output options for a social fetch.
Output-format selection and additional arguments for a
Fetcher. - Filtering
Options - Output filtering requests for host commands.
- Gitlab
Handle gitlab - A GitLab.com username: 2–255 ASCII letters, digits,
_,-, or.; no leading punctuation, trailing dot, repeated dots, or.git/.atomsuffix. Reserved names are not checked. - List
Request - Shared, transport-independent request for a social collection. An owned, transport-independent request to list a collection.
- List
Request Options - Shared ordering, pagination, and output options for a social listing.
Output-format and pagination requests for a
Lister. - Medium
Handle medium - A Medium profile identifier. Accepts a nonempty ASCII alphanumeric,
_,-, or.path segment; account availability and registration rules are not checked. - Pinterest
Handle pinterest - A Pinterest username: 3–30 ASCII letters, digits, or underscores.
- Reddit
Handle reddit - A Reddit username: 3–20 ASCII letters, digits, underscores, or hyphens.
- Snapchat
Handle snapchat - A Snapchat username: 3–15 ASCII letters, digits,
_,-, or.; starts with a letter and ends with a letter or digit. - Social
Client client - A domain-specific façade over ASIMOV’s remote HTTP transport. Responses contain raw JSONL batches, preserving bytes and line endings.
- Substack
Handle substack - A Substack profile identifier. Accepts a nonempty ASCII alphanumeric,
_, or-path segment; publication names and account availability are not checked. - Threads
Handle threads - A Threads username: 1–30 ASCII letters, digits, underscores, or dots; no leading, trailing, or consecutive dots.
- Tiktok
Handle tiktok - A TikTok username: 2–24 ASCII letters, digits, underscores, or dots, with no trailing dot.
- Timing
Options - Execution timing requests shared by program commands.
- Twitch
Handle twitch - A Twitch username: 4–25 ASCII letters, digits, or underscores.
- Youtube
Handle youtube - A YouTube handle without
@. Accepts 1–30 Unicode letters/digits with internal_,-,., or·; language-specific length and script restrictions are not checked.
Enums§
- Follow
Relationship - The direction of a follow relationship with another account.
- Parse
Social Property Error - An error encountered when parsing a
SocialPropertyselector. - Social
Client Error - HTTP adapter configuration, startup, or response-body failure.
- Social
Handle - An account handle paired with the social platform to which it belongs.
- Social
Link - A recognized social-platform URL, classified by the resource it selects.
- Social
Link Conversion Error - A social link or handle cannot be represented by the requested type.
- Social
Link Error - A URL could not be parsed or does not match a supported social link.
- Social
Platform - A social platform, identified by its canonical HTTPS base URL.
- Social
Platform Handle Error - An account identifier could not be parsed on the selected platform.
- Social
Property - A selector for an account’s identity, connections, or content.
Type Aliases§
- Social
Response Stream - A raw JSONL batch stream with HTTP-specific failures.