Class
LeafRenderer
LeafRenderer implements the full Leaf language pipeline.final class LeafRenderer
Overview
It must be configured before use with the appropriate LeafConfiguration and consituent threadsafe protocol-implementating modules (an NIO EventLoop, LeafCache, LeafSource, and potentially any number of custom LeafTag additions to the language).
Additional instances of LeafRenderer can then be created using these shared modules to allow concurrent rendering, potentially with unique per-instance scoped data via userInfo.
Topics
Initializers
init(configuration:tags:cache:sources:eventLoop:userInfo:)Initial configuration of LeafRenderer.
Instance Properties
cacheA thread-safe implementation ofLeafCacheprotocolconfigurationAn initializedLeafConfigurationspecificying default directory and tagIndicatoreventLoopThe NIOEventLoopon which this instance ofLeafRendererwill operatesourcesA thread-safe implementation ofLeafSourceprotocoltagsA keyed dictionary of customLeafTagsto extend Leaf’s basic functionality, registered with the names which will call them when rendering - egtags["tagName"]can be used in a template as#tagName(parameters)userInfoAny custom instance data to use (eg, in Vapor, theApplicationand/orRequestdata)
Instance Methods
render(path:context:)The public interface toLeafRenderer