def PipeSession.wrote
bend-pipe-session@0.2.0.0 · impl.bend:111
import bend-pipe-session@0.2.0.0/impl.bend as Impl
import Base
import bend-stdio-pipes@0.2.0.0/impl.bend as Stdio
111def PipeSession.wrote(
112 pid: U32,
113 wrote: File & Result<&1, &1, U32 & String, Unit>,
114 out: File,
115 +line_cap: U32,
116 +until: String
117) -> IO(PipeSession & Result<&1, &1, U32 & String, List<&2, String>>):
118 match wrote:
119 case (input, Fail{error}):
120 IO.pure(
121 PipeSession & Result<&1, &1, U32 & String, List<&2, String>>,
122 (PipeSession{pid, input, out, line_cap}, Fail{error})
123 )
124 case (input, Done{_}):
125 do IO<PipeSession & Result<&1, &1, U32 & String, List<&2, String>>>:
126 read: File & Result<&1, &1, U32 & String, Maybe<String>> <- Stdio.read_line(out, line_cap)
127 answer: File & Result<&1, &1, U32 & String, List<&2, String>> <-
128 PipeSession.ask.go(4294967295n, Heard.read(read, until), until, line_cap, [])
129 PipeSession.asked(pid, input, line_cap, answer)