Deepmark

Status

class vigil::Status

Return type for all SDK operations. Encapsulates a status code and an optional human-readable error message.

Status.ok

bool vigil::Status::ok() const

Checks whether the operation completed successfully.

Returns:

booltrue if the status code is StatusCode::kOk, false otherwise.

Status.code

vigil::StatusCode vigil::Status::code() const

Returns the specific status code for the operation.

Returns:

StatusCode — One of the values from the StatusCode enum.

Status.message

const std::string& vigil::Status::message() const

Returns a human-readable description of the error. Empty string on success.

Returns:

const std::string& — Error message, or empty string if the operation succeeded.

Status.operator bool

explicit vigil::Status::operator bool() const

Boolean conversion operator. Allows using Status objects directly in conditional expressions. Returns the same value as ok.

Example:
vigil::Status status = embedder.Load();
if (!status) {
    std::cerr << "Error: " << status.message() << "\n";
}

Status Codes

CodeNameDescription
0StatusCode::kOkSuccess.
1StatusCode::kInvalidArgumentInvalid parameter — wrong sample count, null pointer, etc.
2StatusCode::kInvalidStateOperation called in wrong state — e.g., calling EmbedStep before Load.
3StatusCode::kModelLoadFailedModel file not found or corrupt.
4StatusCode::kInferenceFailedModel inference error.
5StatusCode::kBufferOverflowInternal buffer overflow.
6StatusCode::kInternalErrorUnexpected internal error.