XU XUv0.16.0

#text/tabwriter

import: #text/tabwriter

counts: 1 functions, 2 methods, 2 types, 2 constants, 0 method sets

Elastic tabstops: write + flush returns a string.

const ALIGN_RIGHT

XuAPI
pub const ALIGN_RIGHT = 4

Purpose

Constant ALIGN_RIGHT, defining protocol or algorithm parameters.

const DEBUG

XuAPI
pub const DEBUG = 32

Purpose

Constant DEBUG, defining protocol or algorithm parameters.

struct Writer

XuAPI
pub struct Writer {
    pub minwidth int
    pub tabwidth int
    pub padding int
    pub padchar int
    pub flags int
    pub raw string
}

Purpose

Tabwriter Streaming writer and encoder.

Public fields

minwidth int
field (int)
tabwidth int
field (int)
padding int
field (int)
padchar int
field (int)
flags int
field (int)
raw string
field (string)

struct Cell

XuAPI
pub struct Cell {
    pub text string
    pub width int
    pub htab int
}

Purpose

Structure encapsulating text, width, htab.

Public fields

text string
text
width int
field (int)
htab int
field (int)

new_writer

XuAPI
pub fn new_writer(minwidth int, tabwidth int, padding int, padchar int, flags int) Writer

Purpose

Construct writer.

Parameters

minwidth int
minwidth (int)
tabwidth int
tabwidth (int)
padding int
padding (int)
padchar int
padchar (int)
flags int
flags (int)

Returns

Writer — a value of this type

($&Writer) write

XuAPI
pub fn (w $&Writer) write(s &string)

Purpose

Operation on $&Writer: write data and return the byte count.

Parameters

w $&Writer
The Writer instance used by this call (exclusive borrow).
s &string
source string (read-only borrow; caller keeps the original; type &string)

Returns

This call does not return a value.

($&Writer) flush

XuAPI
pub fn (w $&Writer) flush() string

Purpose

Operation on $&Writer: flush buffered data.

Parameters

w $&Writer
The Writer instance used by this call (exclusive borrow).

Returns

string — result string