/*
* Copyright (c) 2023 Vaughn Nugent
*
* Library: VNLib
* Package: VNLib.Net.Messaging.FBM
* File: IFBMMessage.cs
*
* IFBMMessage.cs is part of VNLib.Net.Messaging.FBM which is part of the larger
* VNLib collection of libraries and utilities.
*
* VNLib.Net.Messaging.FBM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* VNLib.Net.Messaging.FBM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
using System;
using VNLib.Net.Http;
namespace VNLib.Net.Messaging.FBM
{
///
/// Represents basic Fixed Buffer Message protocol operations
///
public interface IFBMMessage
{
///
/// The unique id of the message (nonzero)
///
int MessageId { get; }
///
/// Writes a data body to the message of the specified content type
///
/// The body of the message to copy
/// The content type of the message body
///
void WriteBody(ReadOnlySpan body, ContentType contentType = ContentType.Binary);
///
/// Appends an arbitrary header to the current request buffer
///
/// The header id
/// The value of the header
///
void WriteHeader(byte header, ReadOnlySpan value);
///
/// Appends an arbitrary header to the current request buffer
///
/// The of the header
/// The value of the header
///
void WriteHeader(HeaderCommand header, ReadOnlySpan value);
}
}