/*
 * Copyright 2026 Snowflake Inc.
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

// tl::expected — vendored single-header, drop-in for std::expected (C++23).
// When the project adopts C++23, replace this line with:
//   #include <expected>
//   template<typename T> using result = std::expected<T, error>;
#include "snowflake/ingest/streaming/error.hpp"
#include "tl/expected.hpp"

namespace snowflake::ingest::streaming {

/// Alias for tl::expected<T, error>.
///
/// All API methods that can fail return result<T> instead of throwing.
/// On success, use the value directly (implicit conversion / operator*).
/// On failure, call .error() to retrieve the error.
///
/// Example:
///   auto r = client::create(opts);
///   if (!r) {
///     handle(r.error());
///     return;
///   }
///   auto& c = *r;
template <typename T>
using result = tl::expected<T, error>;

}  // namespace snowflake::ingest::streaming
