Documentation
// Copyright (c) 2026, Salesforce, Inc.,
// All rights reserved.
// For full license text, see the LICENSE.txt file

/// A gRPC response containing an inner typed message.
pub struct GrpcResponse<T> {
    inner: T,
}

impl<T> GrpcResponse<T> {
    pub(super) fn new(inner: T) -> Self {
        Self { inner }
    }

    /// Returns a reference to the inner message.
    pub fn get_ref(&self) -> &T {
        &self.inner
    }

    /// Returns a mutable reference to the inner message.
    pub fn get_mut(&mut self) -> &mut T {
        &mut self.inner
    }

    /// Consumes this response and returns the inner message.
    pub fn into_inner(self) -> T {
        self.inner
    }
}