XU XUv0.16.0

#net/mail

import: #net/mail

counts: 2 functions, 2 methods, 1 types, 0 constants, 0 method sets

Mailbox address parsing.

struct Address

XuAPI
pub struct Address {
    pub name string
    pub address string
}

Purpose

Structure encapsulating name, address.

Public fields

name string
name
address string
field (string)

parse_address

XuAPI
pub fn parse_address(s &string) Address

Purpose

Parse as address. Throws on failure; handle the error or propagate it to the caller.

Parameters

s &string
source string (read-only borrow; caller keeps the original; type &string)

Returns

Address — a value of this type

parse_address_list

XuAPI
pub fn parse_address_list(s &string) []Address

Purpose

Parse as address list. Throws on failure; handle the error or propagate it to the caller.

Parameters

s &string
source string (read-only borrow; caller keeps the original; type &string)

Returns

[]Address — slice result

(Address) format

XuAPI
pub fn (a Address) format() string

Purpose

Operation on Address: format as a string. Throws on failure; handle the error or propagate it to the caller.

Parameters

a Address
The Address instance used by this call (value receiver).

Returns

string — result string

(Address) to_string

XuAPI
pub fn (a Address) to_string() string

Purpose

Operation on Address: convert to string.

Parameters

a Address
The Address instance used by this call (value receiver).

Returns

string — result string