ytext_insert

Function ytext_insert 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn ytext_insert( txt: *const Branch, txn: *mut Transaction, index: u32, value: *const c_char, attrs: *const YInput, )
Expand description

Inserts a null-terminated UTF-8 encoded string a given index. index value must be between 0 and a length of a YText (inclusive, accordingly to ytext_len return value), otherwise this function will panic.

A str parameter must be a null-terminated UTF-8 encoded string. This function doesn’t take ownership over a passed value - it will be copied and therefore a string parameter must be released by the caller.

A nullable pointer with defined attrs will be used to wrap provided text with a formatting blocks. attrs must be a map-like type.