parseNumeric

Parser for RPL_TOPIC.

Format is 332 <client><channel> :<topic>

Examples

import std.range : only, takeNone;
{
	immutable topic = parseNumeric!(Numeric.RPL_TOPIC)(only("someone", "#channel", "This is the topic!"));
	assert(topic.get.channel == "#channel");
	assert(topic.get.topic == "This is the topic!");
}
{
	immutable topic = parseNumeric!(Numeric.RPL_TOPIC)(takeNone(only("")));
	assert(topic.isNull);
}
{
	immutable topic = parseNumeric!(Numeric.RPL_TOPIC)(only("someone"));
	assert(topic.isNull);
}
{
	immutable topic = parseNumeric!(Numeric.RPL_TOPIC)(only("someone", "#channel"));
	assert(topic.isNull);
}

Meta