Buf::push_int
pub fn push_int(int n) Import
Source: use fmt::{Buf}; src/fmt.hy Appends n in decimal.
Called on a Buf value as value.push_int(…).
Parameters#
| Name | Type |
|---|---|
n | int |
Examples#
use fmt::{Buf};
use tests::assert;
let b = Buf::new();
b.push_int(-7);
assert!(b.to_string() == "-7");
See also#
Buf: A string builder: append pieces, then take the text withto_string.Buf::new: Creates an empty builder.Buf::push_str: Appendss.Buf::push_hex: Appendsnin lowercase hexadecimal, without a0xprefix.Buf::to_string: Returns the text built so far.Buf::pad_left: Pads the text on the left withfilluntil it is at leastwidthbytes long, and returns the builder.Buf::pad_right: Pads the text on the right withfilluntil it is at leastwidthbytes long, and returns the builder.