Skip to main content

take_owned_text

Function take_owned_text 

Source
pub unsafe fn take_owned_text(buffer: AlefOwnedBuffer) -> String
Expand description

Like take_owned_bytes, but lossily decodes the bytes as UTF-8.

Generated proxies use this to turn a component’s error buffer into a String for constructing the contract’s error type; a component that returns non-UTF-8 error text gets a replacement-character message instead of a panic or a dropped allocation.

§Safety

Same obligations as take_owned_bytes.