FeedLimits
The bounds a FeedParser applies to a document. Stable Core. Built with FeedLimits { maxEntries = 200 }, or derived with FeedLimits(from) { … }; every member can only be tightened: a value above its default or below its floor is refused when the limits are built, so the generous side stays the safe one and a default can be relied on as an upper bound.
| Member | Default | Floor | Exceeding it |
|---|---|---|---|
| maxEntries | 1,000 | 1 | the parse fails with LimitExceeded(Entries) |
| maxTextChars | 262,144 | 16 | text is cut at that many UTF-16 units, never inside a surrogate pair |
| maxIdChars | 2,048 | 50 | an id falls back from the guid to the link to the digest; the digest id is always 50 characters |
| maxLinkChars | 8,000 | 32 | the link is null |
| maxCategoriesPerEntry | 32 | 0 | further categories are dropped |
| maxEnclosuresPerEntry | 8 | 0 | further enclosures are dropped |
| maxDepth | 256 | 4 | the parse fails with LimitExceeded(Depth) |
| maxAttributesPerElement | 100 | 4 | the parse fails with LimitExceeded(Attributes); namespace declarations count as attributes |
| maxElements | 100,000 | 16 | the parse fails with LimitExceeded(Elements) |
| maxNamespaceUris | 64 | 2 | the parse fails with LimitExceeded(NamespaceUris); it counts distinct URIs, not declarations |
A floor keeps a setting from disabling the parser by mistake; it does not promise that any document parses. The document itself is bounded by the transport's decoded-body cap (2 MiB under an Untrusted policy). Equality is on all ten members; toString() prints them.
Types
Collects the members of a FeedLimits, seeded from the value the factory was given. Not thread-safe; use it only inside the factory's lambda.
Properties
The most attributes on one element, namespace declarations included; more fail the parse.
The most categories kept per entry.
The most elements in a document; more fail the parse.
The most enclosures kept per entry.
The most entries a document may hold; more fail the parse.
The most UTF-16 units of a guid or link for it to serve as the id; a longer one falls back.
The most UTF-16 units of a link; a longer one is null.
The most distinct namespace URIs in a document; more fail the parse.
The most UTF-16 units of any text field; longer text is cut.
Functions
Two FeedLimits are equal when all ten of their limits are equal: maxEntries, maxTextChars, maxIdChars, maxLinkChars, maxCategoriesPerEntry, maxEnclosuresPerEntry, maxDepth, maxAttributesPerElement, maxElements and maxNamespaceUris.