api

ssr.ch

Declarations in ssr.ch

47 declarationspage

Declarations

Public only
SsrText#
Publicstruct
struct SsrText { var data : *char var size : u64 }
equals#
Publicfunction
func equals(self : &SsrText, other : &string_view) : bool
equals_text#
Publicfunction
func equals_text(self : &SsrText, other : &SsrText) : bool
MultipleAttributeValues#
Publicstruct
struct MultipleAttributeValues { var data : *SsrAttributeValue var size : u64 }
SsrCallable#
Publicstruct
struct SsrCallable { var fn_ptr : func(*void, &HtmlPage, &string) : void var object : *void }
SsrAttributeValue#
Publicvariant
variant SsrAttributeValue { var None : SsrAttributeValue var Boolean : SsrAttributeValue var Char : SsrAttributeValue var UInteger : SsrAttributeValue var Integer : SsrAttributeValue var Double : SsrAttributeValue var Text : SsrAttributeValue var PtrChar : SsrAttributeValue var Multiple : SsrAttributeValue var Spread : SsrAttributeValue var Callable : SsrAttributeValue }
SsrAttribute#
Publicstruct
struct SsrAttribute { var name : SsrText var value : SsrAttributeValue }
SsrAttributeList#
Publicstruct
struct SsrAttributeList { var data : *SsrAttribute var size : u64 }
getMultipleAttributeValues#
Publicfunction
func getMultipleAttributeValues(val : &SsrAttributeValue) : MultipleAttributeValues
Extracts the array payload from an attribute value, returning an empty list
ssrMultipleGet#
Publicfunction
func ssrMultipleGet(values : MultipleAttributeValues, index : u64) : SsrAttributeValue
Fetches a single element from a Multiple array at runtime. Kept as a
getSsrAttributeValue#
Publicfunction
func getSsrAttributeValue(list : SsrAttributeList, name : SsrText) : SsrAttributeValue
ssrAttrValueProp#
Publicfunction
func ssrAttrValueProp(val : &SsrAttributeValue, name : SsrText) : SsrAttributeValue
ssrTextOf#
function
func ssrTextOf(val : &SsrAttributeValue) : SsrText
Text view of an attribute value for runtime string predicates
ssrTextIncludes#
Publicfunction
func ssrTextIncludes(hay : &SsrAttributeValue, needle : &SsrAttributeValue) : bool
Runtime equivalents of the compile-time predicate operations, used when a
ssrTextStartsWith#
Publicfunction
func ssrTextStartsWith(hay : &SsrAttributeValue, needle : &SsrAttributeValue) : bool
ssrTextEndsWith#
Publicfunction
func ssrTextEndsWith(hay : &SsrAttributeValue, needle : &SsrAttributeValue) : bool
ssr_ascii_lower#
function
func ssr_ascii_lower(c : char) : char
ASCII case folding for `.toLowerCase()` predicates evaluated at SSR. Only
ssr_text_region_fold_equals#
function
func ssr_text_region_fold_equals(a : *char, b : *char, len : u64) : bool
ssrTextIncludesFold#
Publicfunction
func ssrTextIncludesFold(hay : &SsrAttributeValue, needle : &SsrAttributeValue) : bool
ssrTextStartsWithFold#
Publicfunction
func ssrTextStartsWithFold(hay : &SsrAttributeValue, needle : &SsrAttributeValue) : bool
ssrTextEndsWithFold#
Publicfunction
func ssrTextEndsWithFold(hay : &SsrAttributeValue, needle : &SsrAttributeValue) : bool
isSsrAttributeValueTruthy#
Publicfunction
func isSsrAttributeValueTruthy(val : &SsrAttributeValue) : bool
ssrTextEquals#
Publicfunction
func ssrTextEquals(val : &SsrAttributeValue, expected : SsrText) : bool
Compares an attribute value's text content against an expected literal.
appendSsrValueText#
function
func appendSsrValueText(val : &SsrAttributeValue, out : &string) : bool
Canonical text representation of an attribute value, used by ssrValuesEqual.
ssrValuesEqual#
Publicfunction
func ssrValuesEqual(left : &SsrAttributeValue, right : &SsrAttributeValue) : bool
Loose equality between two attribute values (JS `==` semantics for the value
ssrPickValue#
Publicfunction
func ssrPickValue(cond : bool, ifTrue : SsrAttributeValue, ifFalse : SsrAttributeValue) : SsrAttributeValue
Picks between two attribute values based on a runtime condition.
ssrMakeTextValue#
Publicfunction
func ssrMakeTextValue(text : SsrText) : SsrAttributeValue
Wraps a static text into an attribute value.
ssrMakeBoolValue#
Publicfunction
func ssrMakeBoolValue(value : bool) : SsrAttributeValue
ssrMakeUIntegerValue#
Publicfunction
func ssrMakeUIntegerValue(value : u64) : SsrAttributeValue
ssrMakeIntegerValue#
Publicfunction
func ssrMakeIntegerValue(value : i64) : SsrAttributeValue
ssrMakeMultipleValue#
Publicfunction
func ssrMakeMultipleValue(value : MultipleAttributeValues) : SsrAttributeValue
ssrNoneValue#
Publicfunction
func ssrNoneValue() : SsrAttributeValue
appendHtmlEscaped#
function
func appendHtmlEscaped(output : &string, text : &string_view) : void
appendJsHex2#
function
func appendJsHex2(output : &string, v : uint) : void
appendJsEscaped#
function
func appendJsEscaped(output : &string, text : &string_view) : void
AttrValueTarget#
enum
enum AttrValueTarget { Html, Js }
writeAttrValue#
function
func writeAttrValue(page : &HtmlPage, output : &string, attrVal : &SsrAttributeValue, target : AttrValueTarget) : void
Single attribute-value writer, parameterized by output target and escaping
writePrimitiveAttrValue#
function
func writePrimitiveAttrValue(page : &HtmlPage, output : &string, attrVal : &SsrAttributeValue) : void
writeJsPrimitiveAttrValue#
function
func writeJsPrimitiveAttrValue(page : &HtmlPage, output : &string, attrVal : &SsrAttributeValue) : void
SpecialAttrs#
struct
struct SpecialAttrs { var classes : vector<*SsrAttributeValue> var styles : vector<*SsrAttributeValue> var others_names : vector<SsrText> var others_values : vector<*SsrAttributeValue> }
Attribute accumulator: merges class/style and deduplicates the rest
make#
functionConstructor
func make() : SpecialAttrs
Attribute accumulator: merges class/style and deduplicates the rest
delete#
function
func delete(self : *SpecialAttrs) : void
Attribute accumulator: merges class/style and deduplicates the rest
make_special_attrs#
function
func make_special_attrs() : SpecialAttrs
accumulateAttrs#
function
func accumulateAttrs(list : &SsrAttributeList, special : &SpecialAttrs) : void
renderHtmlAttrs#
Publicfunction
func renderHtmlAttrs(page : &HtmlPage, list : &SsrAttributeList) : void
renderHtmlAttrsWithBase#
Publicfunction
func renderHtmlAttrsWithBase(page : &HtmlPage, list : &SsrAttributeList, baseClass : SsrText) : void
Like `renderHtmlAttrs`, but prepends `baseClass` to the element's class list.
renderJsAttrs#
Publicfunction
func renderJsAttrs(page : &HtmlPage, list : &SsrAttributeList) : void
renderHtmlAttrValue#
Publicfunction
func renderHtmlAttrValue(page : &HtmlPage, attrVal : &SsrAttributeValue) : void
renderHtmlChildValue#
Publicfunction
func renderHtmlChildValue(page : &HtmlPage, attrVal : &SsrAttributeValue) : void
renderJsAttrValue#
Publicfunction
func renderJsAttrValue(page : &HtmlPage, attrVal : &SsrAttributeValue) : void
renderCssAttrValue#
Publicfunction
func renderCssAttrValue(page : &HtmlPage, attrVal : &SsrAttributeValue) : void