mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
add documentation for public functions/structs
This commit is contained in:
parent
e4acd93ed3
commit
7fdcb0e130
1 changed files with 2 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
module json2
|
module json2
|
||||||
|
|
||||||
|
// EncoderOptions provides a list of options for encoding
|
||||||
@[params]
|
@[params]
|
||||||
pub struct EncoderOptions {
|
pub struct EncoderOptions {
|
||||||
pub:
|
pub:
|
||||||
|
@ -26,6 +27,7 @@ fn workaround_cast[T](val voidptr) T {
|
||||||
return *(&T(val))
|
return *(&T(val))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// encode is a generic function that encodes a type into a JSON string.
|
||||||
pub fn encode[T](val T, config EncoderOptions) string {
|
pub fn encode[T](val T, config EncoderOptions) string {
|
||||||
mut encoder := Encoder{
|
mut encoder := Encoder{
|
||||||
EncoderOptions: config
|
EncoderOptions: config
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue