cohtml.Net.ResourceResponse
Response that the application should use when the resource has been loaded You can keep a reference to this object as long as needed and call Finish afterwards.
Inherits from SystemIDisposable
Public Classes
Section titled “Public Classes”| Name | |
|---|---|
| class | UserImageData Description of the properties of the user provided image. |
Public Types
Section titled “Public Types”| Name | |
|---|---|
| enum class | Status { Success, Failure} |
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| virtual void | Dispose() |
| virtual global.System.IntPtr | GetSpace(ulong size) Allocates more space where to put the data read. NB: You can call the function multiple times and it’ll allocate more space if needed. The space requested MUST be the SUM of all space required. Already copied data will be still available in the buffer - it works the same way as “realloc”. The pointer returned will always point to the beginning of the data array. Users have to keep an offset counter themselves if they plan to call GetSpace() multiple times. |
| virtual void | ReceiveOptimizedData(DataBuffer optimizedData) Passes optimized data that speeds up the resource processing. Currently, this can speed up the JavaScript compilation and run times, the optimizedData can be obtained using the cohtml.ScriptCompiler.Compile. |
| virtual void | SignalProgress() Can be called when part of the response is ready and can be used by the backend. Calling this is optional. Note that the pointer returned by GetSpace will not be valid anymore. The user will have to request some more memory for the fresh data after this call. |
| virtual void | SetStatus(ushort status) Additional API used for complex responses like HTTP. Setting these fields is not required for local “coui” loads. |
| virtual void | SetResponseURL(string responseURL) The URL of the response (can change from the request due to redirects) |
| virtual void | SetHeader(string name, string value) Set a response header. |
| virtual void | SetStreamReader(ISyncStreamReader reader) Set the ISyncStreamReader instance for the requested resource. |
| virtual void | Finish(ResourceResponse.Status status) Call when the resource has been loaded or the load failed. After this call the object is invalidated. NB: It’s not safe to call any methods on this interface after Finish. |
| void | ReceiveUserImage(ResourceResponse.UserImageData preloadedImage) Passes data about a user image that is ready to be used by the UI system. This lets Cohtml use textures that are already on the GPU and the void* is interpreted by the backend. |
| delegate global.System.IntPtr | SwigDelegateResourceResponse_0(ulong size, global.System.IntPtr swigId) |
| delegate void | SwigDelegateResourceResponse_1(global.System.IntPtr optimizedData, global.System.IntPtr swigId) |
| delegate void | SwigDelegateResourceResponse_2(global.System.IntPtr swigId) |
| delegate void | SwigDelegateResourceResponse_3(ushort status, global.System.IntPtr swigId) |
| delegate void | SwigDelegateResourceResponse_4(string responseURL, global.System.IntPtr swigId) |
| delegate void | SwigDelegateResourceResponse_5(string name, string value, global.System.IntPtr swigId) |
| delegate void | SwigDelegateResourceResponse_6(global.System.IntPtr reader, global.System.IntPtr swigId) |
| delegate void | SwigDelegateResourceResponse_7(int status, global.System.IntPtr swigId) |
Protected Functions
Section titled “Protected Functions”| Name | |
|---|---|
| ResourceResponse() |
Protected Attributes
Section titled “Protected Attributes”| Name | |
|---|---|
| bool | swigCMemOwn |
Public Types Documentation
Section titled “Public Types Documentation”enum Status
Section titled “enum Status”| Enumerator | Value | Description |
|---|---|---|
| Success | ||
| Failure |
Public Functions Documentation
Section titled “Public Functions Documentation”function Dispose
Section titled “function Dispose”virtual void Dispose()function GetSpace
Section titled “function GetSpace”virtual global.System.IntPtr GetSpace( ulong size)Allocates more space where to put the data read. NB: You can call the function multiple times and it’ll allocate more space if needed. The space requested MUST be the SUM of all space required. Already copied data will be still available in the buffer - it works the same way as “realloc”. The pointer returned will always point to the beginning of the data array. Users have to keep an offset counter themselves if they plan to call GetSpace() multiple times.
function ReceiveOptimizedData
Section titled “function ReceiveOptimizedData”virtual void ReceiveOptimizedData( DataBuffer optimizedData)Passes optimized data that speeds up the resource processing. Currently, this can speed up the JavaScript compilation and run times, the optimizedData can be obtained using the cohtml.ScriptCompiler.Compile.
Parameters:
- optimizedData is a data, produced by doing resource processing ahead of time and can be easily cached, serialized and deserialized.
function SignalProgress
Section titled “function SignalProgress”virtual void SignalProgress()Can be called when part of the response is ready and can be used by the backend. Calling this is optional. Note that the pointer returned by GetSpace will not be valid anymore. The user will have to request some more memory for the fresh data after this call.
function SetStatus
Section titled “function SetStatus”virtual void SetStatus( ushort status)Additional API used for complex responses like HTTP. Setting these fields is not required for local “coui” loads.
function SetResponseURL
Section titled “function SetResponseURL”virtual void SetResponseURL( string responseURL)The URL of the response (can change from the request due to redirects)
function SetHeader
Section titled “function SetHeader”virtual void SetHeader( string name, string value)Set a response header.
function SetStreamReader
Section titled “function SetStreamReader”virtual void SetStreamReader( ISyncStreamReader reader)Set the ISyncStreamReader instance for the requested resource.
function Finish
Section titled “function Finish”virtual void Finish( ResourceResponse.Status status)Call when the resource has been loaded or the load failed. After this call the object is invalidated. NB: It’s not safe to call any methods on this interface after Finish.
function ReceiveUserImage
Section titled “function ReceiveUserImage”void ReceiveUserImage( ResourceResponse.UserImageData preloadedImage)Passes data about a user image that is ready to be used by the UI system. This lets Cohtml use textures that are already on the GPU and the void* is interpreted by the backend.
Parameters:
- preloadedImage The provided preloaded image.
function SwigDelegateResourceResponse_0
Section titled “function SwigDelegateResourceResponse_0”delegate global.System.IntPtr SwigDelegateResourceResponse_0( ulong size, global.System.IntPtr swigId)function SwigDelegateResourceResponse_1
Section titled “function SwigDelegateResourceResponse_1”delegate void SwigDelegateResourceResponse_1( global.System.IntPtr optimizedData, global.System.IntPtr swigId)function SwigDelegateResourceResponse_2
Section titled “function SwigDelegateResourceResponse_2”delegate void SwigDelegateResourceResponse_2( global.System.IntPtr swigId)function SwigDelegateResourceResponse_3
Section titled “function SwigDelegateResourceResponse_3”delegate void SwigDelegateResourceResponse_3( ushort status, global.System.IntPtr swigId)function SwigDelegateResourceResponse_4
Section titled “function SwigDelegateResourceResponse_4”delegate void SwigDelegateResourceResponse_4( string responseURL, global.System.IntPtr swigId)function SwigDelegateResourceResponse_5
Section titled “function SwigDelegateResourceResponse_5”delegate void SwigDelegateResourceResponse_5( string name, string value, global.System.IntPtr swigId)function SwigDelegateResourceResponse_6
Section titled “function SwigDelegateResourceResponse_6”delegate void SwigDelegateResourceResponse_6( global.System.IntPtr reader, global.System.IntPtr swigId)function SwigDelegateResourceResponse_7
Section titled “function SwigDelegateResourceResponse_7”delegate void SwigDelegateResourceResponse_7( int status, global.System.IntPtr swigId)Protected Functions Documentation
Section titled “Protected Functions Documentation”function ResourceResponse
Section titled “function ResourceResponse”ResourceResponse()Protected Attributes Documentation
Section titled “Protected Attributes Documentation”variable swigCMemOwn
Section titled “variable swigCMemOwn”bool swigCMemOwn;© 2026 Coherent Labs. All rights reserved.