<preclass='rust fn'>pub fn to_vec<T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>>(value: &T) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>, <aclass="enum"href="../../toml/ser/enum.Error.html"title="enum toml::ser::Error">Error</a>><spanclass="where fmt-newline">where<br> T: <aclass="trait"href="../../serde/ser/trait.Serialize.html"title="trait serde::ser::Serialize">Serialize</a>, </span></pre><divclass='docblock'><p>Serialize the given data structure as a TOML byte vector.</p>
<p>Serialization can fail if <code>T</code>'s implementation of <code>Serialize</code> decides to
fail, if <code>T</code> contains a map with non-string keys, or if <code>T</code> attempts to
serialize an unsupported datatype such as an enum, tuple, or tuple struct.</p>