Function toInt [src]

Convert self to integer type T. Returns an error if self cannot be narrowed into the requested type without truncation.

Prototype

pub fn toInt(self: Managed, comptime T: type) ConvertError!T

Parameters

self: ManagedT: type

Possible Errors

NegativeIntoUnsigned ConvertError
TargetTooSmall ConvertError

Source

pub fn toInt(self: Managed, comptime T: type) ConvertError!T { return self.toConst().toInt(T); }