Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Function |into_json

json/value::|into_json


Usage

|into_json<T>(value)

Generics

◻ T: Serialize

Parameters

↳ value: T

Return

↴ Option<Json>


Return value as JSON, or none if it cannot be written as JSON, such as secrets.

Numbers, booleans, strings, bytes and characters become JSON scalars, void and none become null, vectors become arrays, and data types are written as they define, such as StringMap as an object of strings.