blob: d6cb061ab5c1ea54d01597701b250eb987e3bf9f [file]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
// DO NOT EDIT IT MANUALLY. This file is generated by opendal/dev/src/generate/dotnet.rs.
using System.Runtime.InteropServices;
namespace OpenDAL.Interop.NativeObject;
/// <summary>
/// Mirror of the native <c>OpendalMetadata</c> struct. Fields follow the
/// accessor order of <c>opendal::Metadata</c>; optional values flatten into
/// a <c>HasValue</c> byte followed by their parts.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
internal struct OpenDALMetadata
{
{%- for f in fields %}
{%- for p in f.parts %}
public {{ p.interop_type }} {{ p.pascal }};
{%- endfor %}
{%- endfor %}
/// <summary>
/// Converts this native payload into managed metadata.
/// </summary>
public readonly Metadata ToMetadata()
{
return new Metadata(
{%- for f in fields %}
{{ f.cs_read }}{% if not loop.last %},{% endif %}
{%- endfor %}
);
}
}