Function toInt [src]

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

Prototype

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

Parameters

self: ManagedInt: type

Possible Errors

NegativeIntoUnsigned ConvertError
TargetTooSmall ConvertError

Source

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