vibe.d beta banner
get vibe.d
0.7.31

Asynchronous I/O that doesn’t get in your way, written in D

Struct ValidUsername

Validated user name parameter type.

struct ValidUsername ;

Constructors

Constructors

NameDescription
this

Methods

Methods

NameDescription
fromStringValidate
toString

See also

vibe.utils.validation.validateUsername

Example

class WebService {
	void setUsername(ValidUsername username)
	{
		// username is enforced to be valid here
	}

	void updateProfileInfo(Nullable!ValidUsername username, Nullable!string full_name)
	{
		// username is optional, but always valid
		// full_name is optional and not validated
	}
}
Authors

Sönke Ludwig

Copyright

© 2014 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.