[#boost-urls-grammar-literal_rule]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/grammar.adoc[grammar]::literal&lowbar;rule
:relfileprefix: ../../../
:mrdocs:

Match a string literal exactly

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/literal_rule.hpp#L44[boost&sol;url&sol;grammar&sol;literal&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class literal&lowbar;rule;
----

== Types

[cols=1]
|===
| Name
| xref:boost/urls/grammar/literal_rule/value_type.adoc[`value&lowbar;type`] 
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| xref:boost/urls/grammar/literal_rule/2constructor.adoc[`literal&lowbar;rule`]         [.small]#[constructor]#
| Construct from `char`
| xref:boost/urls/grammar/literal_rule/parse.adoc[`parse`] 
| 
|===

== Description

If there is no more input, or if the end of the input is reached, and a prefix of the literal matches exactly, the error returned is xref:boost/urls/grammar/error.adoc[`error&colon;&colon;need&lowbar;more`]&period;

== Value Type
[,cpp]
----
using value_type = core::string_view;
----
== Example
Rules are used with the function xref:boost/urls/grammar/literal_rule/parse.adoc[`parse`]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( "HTTP", literal_rule( "HTTP" ) );
----
== See Also

xref:boost/urls/grammar/delim_rule-0a.adoc[`delim&lowbar;rule`], xref:boost/urls/grammar/literal_rule/parse.adoc[`parse`]&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
