pub trait ToStub {
// Required method
fn fmt_stub(&self, buf: &mut String) -> FmtResult;
// Provided method
fn to_stub(&self) -> Result<String, FmtError> { ... }
}
Expand description
Implemented on types which can be converted into PHP stubs.
Converts the implementor into PHP code, represented as a PHP stub.
§Parameters
buf
- The buffer to write the PHP code into.
§Returns
Returns nothing on success. Returns an error if there was an error
writing into the buffer.
Converts the implementor into PHP code, represented as a PHP stub.
Returned as a string.
§Returns
Returns a string on success. Returns an error if there was an error
writing into the string.