Lines Matching refs:output
21 /// JSON encoder with additional formats, used to output JsonValue instances in JSON format to the specified location.
25 output: &'a mut W,
32 pub(crate) fn new(output: &'a mut W) -> Self {
33 Self { output, tab: 0 }
39 self.output.write_all(LINE_FEED_STR)?;
58 self.output.write_all(FOUR_SPACES_STR)?;
65 encode_null(self.output)
70 encode_boolean(self.output, *boolean)
75 encode_number(self.output, number)
80 encode_string(self.output, key)
86 encode_string(self.output, unsafe {
94 encode_string(self.output, string)
109 self.output.write_all(LEFT_SQUARE_BRACKET_STR)?;
111 self.output.write_all(LINE_FEED_STR)?;
116 self.output.write_all(COMMA_STR)?;
117 self.output.write_all(LINE_FEED_STR)?;
122 self.output.write_all(LINE_FEED_STR)?;
128 self.output.write_all(COMMA_STR)?;
129 self.output.write_all(SPACE_STR)?;
134 self.output.write_all(RIGHT_SQUARE_BRACKET_STR)?;
140 self.output.write_all(LEFT_CURLY_BRACKET_STR)?;
144 self.output.write_all(COMMA_STR)?;
146 self.output.write_all(LINE_FEED_STR)?;
149 self.output.write_all(COLON_STR)?;
150 self.output.write_all(SPACE_STR)?;
156 self.output.write_all(LINE_FEED_STR)?;
159 self.output.write_all(RIGHT_CURLY_BRACKET_STR)?;
165 /// used to output a JsonValue instance in JSON format to a specified location.
167 output: &'a mut W,
172 pub(crate) fn new(output: &'a mut W) -> Self {
173 Self { output }
195 encode_null(self.output)
200 encode_boolean(self.output, *boolean)
205 encode_number(self.output, number)
210 encode_string(self.output, key)
216 encode_string(self.output, unsafe {
224 encode_string(self.output, string)
229 self.output.write_all(LEFT_SQUARE_BRACKET_STR)?;
232 self.output.write_all(COMMA_STR)?;
236 self.output.write_all(RIGHT_SQUARE_BRACKET_STR)?;
242 self.output.write_all(LEFT_CURLY_BRACKET_STR)?;
245 self.output.write_all(COMMA_STR)?;
248 self.output.write_all(COLON_STR)?;
251 self.output.write_all(RIGHT_CURLY_BRACKET_STR)?;
397 ($encoder: ident, $input: expr, $output: expr $(,)?) => {
402 assert_eq!(writer.string, $output);