parseNumeric

Parser for ERR_NOSUCHSERVER

Format is 402 <client> <server> :No such server

Examples

import std.range : only, takeNone;
{
	auto reply = parseNumeric!(Numeric.ERR_NOSUCHSERVER)(only("someone", "badserver.example.net", "No such server"));
	assert(reply.get.serverMask == "badserver.example.net");
	assert(reply.get.message == "No such server");
}
{
	immutable reply = parseNumeric!(Numeric.ERR_NOSUCHSERVER)(only("someone", "badserver.example.net"));
	assert(reply.isNull);
}
{
	immutable reply = parseNumeric!(Numeric.ERR_NOSUCHSERVER)(only("someone"));
	assert(reply.isNull);
}
{
	immutable reply = parseNumeric!(Numeric.ERR_NOSUCHSERVER)(takeNone(only("")));
	assert(reply.isNull);
}

Meta