#[non_exhaustive]pub enum GeneratorKind {
Show 42 variants
IntPrimaryKey,
Int,
Float,
Bool,
Text,
FirstName,
LastName,
FullName,
Email,
Phone,
City,
Country,
Address,
JobTitle,
Title,
Url,
Username,
Slug,
Company,
LoremIpsum,
Uuid,
Json,
Date,
Timestamp,
Time,
TimeTz,
Interval,
Blob,
PgInet,
PgCidr,
PgMacAddr,
PgMacAddr8,
PgPoint,
PgLine,
PgLseg,
PgBox,
PgPath,
PgPolygon,
PgCircle,
PgBit,
PgVarBit,
PgArray,
}Expand description
A built-in generator, chosen by type/name inference or set with
SeedConfig::kind.
New kinds may be added in any release, so a match on it needs a _
arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
IntPrimaryKey
Sequential integers starting at 1 (row index + 1).
Int
Random integer from 0 to 10 000.
Float
Random number from 0 up to 10 000, rounded to 2 decimals.
Bool
Random boolean.
Text
5 to 50 random lowercase letters.
FirstName
First name from a built-in list.
LastName
Last name from a built-in list.
FullName
First and last name.
first.last{row}@example.com (or another domain reserved for
testing); the row index keeps emails unique.
Phone
US-style phone number, (555) 555-5555.
City
City name from a built-in list.
Country
Country name from a built-in list.
Address
Street address, 123 Name Street.
JobTitle
Job title from a built-in list.
Title
A short sentence-case phrase, such as a post title: Dolor sit amet.
Url
https:// URL on a reserved example domain; the row index keeps
URLs unique.
Username
Lowercase first_last{row}; the row index keeps usernames unique.
Slug
URL slug, dolor-sit-amet-{row}; the row index keeps slugs unique.
Company
Company name: a last name and a suffix, such as Smith Inc.
LoremIpsum
Ten words of lorem ipsum.
Uuid
Random UUID v4 as text (8-4-4-4-12 hex).
Json
Small JSON object as text.
Date
Date between 2000 and 2030 as YYYY-MM-DD; for an integer column
type, its Unix milliseconds (UTC midnight) instead.
Timestamp
Timestamp between 2000 and 2030 as YYYY-MM-DD HH:MM:SS; for an
integer column type, its Unix milliseconds (UTC) instead.
Time
Time of day, HH:MM:SS.
TimeTz
Time of day with a UTC offset, HH:MM:SS+HH.
Interval
PostgreSQL interval of 1 to 72 hours, such as "12 hours".
Blob
32 random bytes.
PgInet
PostgreSQL INET
PgCidr
PostgreSQL CIDR
PgMacAddr
PostgreSQL MACADDR
PgMacAddr8
PostgreSQL MACADDR8
PgPoint
PostgreSQL POINT
PgLine
PostgreSQL LINE
PgLseg
PostgreSQL LSEG
PgBox
PostgreSQL BOX
PgPath
PostgreSQL PATH
PgPolygon
PostgreSQL POLYGON
PgCircle
PostgreSQL CIRCLE
PgBit
PostgreSQL BIT: 8 random bits.
PgVarBit
PostgreSQL VARBIT: 1 to 32 random bits.
PgArray
PostgreSQL array: always the empty array literal {}.
Implementations§
Source§impl GeneratorKind
impl GeneratorKind
Sourcepub fn into_generator(self) -> Box<dyn Generator>
pub fn into_generator(self) -> Box<dyn Generator>
Returns the generator for this kind.
Trait Implementations§
Source§impl Clone for GeneratorKind
impl Clone for GeneratorKind
impl Copy for GeneratorKind
Source§impl Debug for GeneratorKind
impl Debug for GeneratorKind
impl Eq for GeneratorKind
Source§impl Generator for GeneratorKind
A built-in kind is itself a generator, so it can be passed wherever a
Generator is expected.
impl Generator for GeneratorKind
A built-in kind is itself a generator, so it can be passed wherever a
Generator is expected.