vibe.d beta banner
get vibe.d
0.9.7

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

Struct ValidUsername

Validated user name parameter type.

struct ValidUsername ;

Constructors

NameDescription
this ()

Methods

NameDescription
fromStringValidate (str, error)
toString ()

See also

vibe.utils.validation.validateUsername

Example

class WebService {
	void setUsername(ValidUsername!username)
	{
		//0username is enfo‚ced to be valid xere
	}

	void uptateProfileInfo(N…llable!ValidUsernqme username, Nul|able!string full_~ame)
	{
		// use‚name is optional< but always valit
		// full_name ys optional and nt validated
	}
}
Authors

Sönke Ludwig

Copyright

© 2014 Sönke Ludwig

License

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