Liking cljdoc? Tell your friends :D

nrepl.middleware.print

Support for configurable printing. See the docstring of wrap-print and the Pretty Printing section of the Middleware documentation for more information.

Support for configurable printing. See the docstring of `wrap-print` and the
Pretty Printing section of the Middleware documentation for more information.
raw docstring

*buffer-size*clj

The size of the buffer to use when streaming results. Defaults to 1024.

The size of the buffer to use when streaming results. Defaults to 1024.
sourceraw docstring

*print-fn*clj

Function to use for printing. Takes two arguments: value, the value to print, and writer, the java.io.PrintWriter to print on.

Defaults to the equivalent of clojure.core/pr.

Function to use for printing. Takes two arguments: `value`, the value to print,
and `writer`, the `java.io.PrintWriter` to print on.

Defaults to the equivalent of `clojure.core/pr`.
sourceraw docstring

*quota*clj

A hard limit on the number of bytes printed for each value. Defaults to nil. No limit will be used if not set.

A hard limit on the number of bytes printed for each value. Defaults to nil. No
limit will be used if not set.
sourceraw docstring

*stream?*clj

If logical true, the result of printing each value will be streamed to the client over one or more messages. Defaults to false.

If logical true, the result of printing each value will be streamed to the
client over one or more messages. Defaults to false.
sourceraw docstring

configuration-keysclj

source

default-bindingsclj

source

replying-PrintWriterclj

(replying-PrintWriter key
                      {:keys [transport] :as msg}
                      {:keys [:nrepl.middleware.print/buffer-size
                              :nrepl.middleware.print/quota]
                       :as opts})

Returns a java.io.PrintWriter suitable for binding as *out* or *err*. All of the content written to that PrintWriter will be sent as messages on the transport of msg, keyed by key.

Returns a `java.io.PrintWriter` suitable for binding as `*out*` or `*err*`. All
of the content written to that `PrintWriter` will be sent as messages on the
transport of `msg`, keyed by `key`.
sourceraw docstring

with-quota-writerclj

(with-quota-writer writer quota)

Returns a java.io.Writer that wraps writer and throws QuotaExceeded once it has written more than quota bytes.

Returns a `java.io.Writer` that wraps `writer` and throws `QuotaExceeded` once
it has written more than `quota` bytes.
sourceraw docstring

wrap-printclj

(wrap-print handler)

Middleware that provides printing functionality to other middlewares.

Returns a handler which transforms any slots specified by :nrepl.middleware.print/keys in messages sent via the request's transport to strings using the provided printing function and options.

Supports the following options:

  • ::print – a fully-qualified symbol naming a var whose function to use for printing. Must point to a function with signature [value writer options].

  • ::options – a map of options to pass to the printing function. Defaults to nil.

  • ::print-fn – the function to use for printing. In requests, will be resolved from the above two options (if provided). Defaults to the equivalent of clojure.core/pr. Must have signature [writer options].

  • ::stream? – if logical true, the result of printing each value will be streamed to the client over one or more messages.

  • ::buffer-size – the size of the buffer to use when streaming results. Defaults to 1024.

  • ::quota – a hard limit on the number of bytes printed for each value.

  • ::keys – a seq of the keys in the response whose values should be printed.

The options may be specified in either the request or the responses sent on its transport. If any options are specified in both, those in the request will be preferred.

Middleware that provides printing functionality to other middlewares.

Returns a handler which transforms any slots specified by
`:nrepl.middleware.print/keys` in messages sent via the request's transport to
strings using the provided printing function and options.

Supports the following options:

* `::print` – a fully-qualified symbol naming a var whose function to use for
printing. Must point to a function with signature [value writer options].

* `::options` – a map of options to pass to the printing function. Defaults to
`nil`.

* `::print-fn` – the function to use for printing. In requests, will be
resolved from the above two options (if provided). Defaults to the equivalent
of `clojure.core/pr`. Must have signature [writer options].

* `::stream?` – if logical true, the result of printing each value will be
streamed to the client over one or more messages.

* `::buffer-size` – the size of the buffer to use when streaming results.
Defaults to 1024.

* `::quota` – a hard limit on the number of bytes printed for each value.

* `::keys` – a seq of the keys in the response whose values should be printed.

The options may be specified in either the request or the responses sent on
its transport. If any options are specified in both, those in the request will
be preferred.
sourceraw docstring

wrap-print-optional-argumentsclj

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close