qrkit/content

Domain-specific helpers that produce QR-ready payload strings.

Types

pub opaque type CalendarEvent
pub opaque type VCard
pub type WifiSecurity {
  Open
  Wep
  Wpa
  Wpa2
  Wpa3
}

Constructors

  • Open
  • Wep
  • Wpa
  • Wpa2
  • Wpa3

Values

pub fn email(
  to to: String,
  subject subject: String,
  body body: String,
) -> String

Build a mailto: payload.

pub fn event(
  title title: String,
  start_unix start_unix: Int,
  end_unix end_unix: Int,
) -> CalendarEvent

Create a calendar event payload builder.

pub fn event_to_string(event: CalendarEvent) -> String

Render a calendar event as an iCalendar payload.

pub fn geo(
  latitude latitude: Float,
  longitude longitude: Float,
) -> String

Build a geo URI.

pub fn phone(number: String) -> String

Build a phone URI.

pub fn sms(to to: String, body body: String) -> String

Build an SMS payload.

pub fn url(href: String) -> String

Return a URL payload unchanged.

pub fn vcard() -> VCard

Create an empty vCard builder.

pub fn vcard_to_string(card: VCard) -> String

Render the vCard as a text payload.

pub fn wifi(
  ssid ssid: String,
  password password: String,
  security security: WifiSecurity,
  hidden hidden: Bool,
) -> String

Build a WiFi payload string.

pub fn with_address(card: VCard, address: String) -> VCard

Set the address field.

pub fn with_all_day(
  event: CalendarEvent,
  all_day: Bool,
) -> CalendarEvent

Toggle all-day rendering.

pub fn with_description(
  event: CalendarEvent,
  desc: String,
) -> CalendarEvent

Set the event description.

pub fn with_email(card: VCard, email: String) -> VCard

Set the e-mail address.

pub fn with_location(
  event: CalendarEvent,
  loc: String,
) -> CalendarEvent

Set the event location.

pub fn with_name(card: VCard, name: String) -> VCard

Set the display name.

pub fn with_organization(card: VCard, org: String) -> VCard

Set the organization field.

pub fn with_phone(card: VCard, phone: String) -> VCard

Set the phone number.

pub fn with_title(card: VCard, title: String) -> VCard

Set the title field.

pub fn with_url(card: VCard, url: String) -> VCard

Set the URL field.

Search Document