bonsai
-
bonsai
-
-
bonsai.bench
-
bonsai.example_chat_open_source_native
-
bonsai.example_chat_open_source_native_common
-
-
bonsai.extra
-
-
bonsai.focus_ring
-
bonsai.protocol
-
bonsai.tailwind_colors
-
bonsai.test
-
bonsai.test.dot
-
bonsai.web_test
-
bonsai.web_ui_common_components
-
bonsai.web_ui_drag_and_drop
-
bonsai.web_ui_element_size_hooks
-
bonsai.web_ui_file
-
bonsai.web_ui_file_from_web_file
-
bonsai.web_ui_form
-
-
bonsai.web_ui_freeform_multiselect
-
bonsai.web_ui_multi_select
-
-
bonsai.web_ui_query_box
-
bonsai.web_ui_reorderable_list
-
bonsai.web_ui_typeahead
Library
Module
Module type
Parameter
Class
Class type
val create_static : filename:string -> contents:string -> t
Create a t
with the given contents
val create_stream : filename:string -> total_bytes:int -> t
Create a t
that can be fed bytes continually using feed_exn
.
total_bytes
will be fed through to the Progress
value in any reads. Note that we do nothing smart to close t
when you have fed at least total_bytes
bytes to t
.
val feed_exn : t -> string -> unit
If t
was created using create_stream
, you can feed it more bytes. Raises if t
was created using create_static
, or if close
or close_error
have been called.
val close : t -> unit
Mark t
as closed so that any file reads based on t
will be marked complete. close
is idempotent and does nothing if t
was created using create_static
.
val close_error : t -> Core.Error.t -> unit
Close t
with an error to emulate an error when reading from the file. Does nothing if close
has already been called or t
was created using create_static
.
val read_status : t -> [ `Aborted | `Not_reading | `Reading ]
Describes whether a read is currently ongoing for the stream in question.