// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package trace // import "go.opentelemetry.io/otel/sdk/trace"

import (
	

	
	
	
	
)

// snapshot is an record of a spans state at a particular checkpointed time.
// It is used as a read-only representation of that state.
type snapshot struct {
	name                  string
	spanContext           trace.SpanContext
	parent                trace.SpanContext
	spanKind              trace.SpanKind
	startTime             time.Time
	endTime               time.Time
	attributes            []attribute.KeyValue
	events                []Event
	links                 []Link
	status                Status
	childSpanCount        int
	droppedAttributeCount int
	droppedEventCount     int
	droppedLinkCount      int
	resource              *resource.Resource
	instrumentationScope  instrumentation.Scope
}

var _ ReadOnlySpan = snapshot{}

func (snapshot) () {}

// Name returns the name of the span.
func ( snapshot) () string {
	return .name
}

// SpanContext returns the unique SpanContext that identifies the span.
func ( snapshot) () trace.SpanContext {
	return .spanContext
}

// Parent returns the unique SpanContext that identifies the parent of the
// span if one exists. If the span has no parent the returned SpanContext
// will be invalid.
func ( snapshot) () trace.SpanContext {
	return .parent
}

// SpanKind returns the role the span plays in a Trace.
func ( snapshot) () trace.SpanKind {
	return .spanKind
}

// StartTime returns the time the span started recording.
func ( snapshot) () time.Time {
	return .startTime
}

// EndTime returns the time the span stopped recording. It will be zero if
// the span has not ended.
func ( snapshot) () time.Time {
	return .endTime
}

// Attributes returns the defining attributes of the span.
func ( snapshot) () []attribute.KeyValue {
	return .attributes
}

// Links returns all the links the span has to other spans.
func ( snapshot) () []Link {
	return .links
}

// Events returns all the events that occurred within in the spans
// lifetime.
func ( snapshot) () []Event {
	return .events
}

// Status returns the spans status.
func ( snapshot) () Status {
	return .status
}

// InstrumentationScope returns information about the instrumentation
// scope that created the span.
func ( snapshot) () instrumentation.Scope {
	return .instrumentationScope
}

// InstrumentationLibrary returns information about the instrumentation
// library that created the span.
func ( snapshot) () instrumentation.Library { //nolint:staticcheck // This method needs to be define for backwards compatibility
	return .instrumentationScope
}

// Resource returns information about the entity that produced the span.
func ( snapshot) () *resource.Resource {
	return .resource
}

// DroppedAttributes returns the number of attributes dropped by the span
// due to limits being reached.
func ( snapshot) () int {
	return .droppedAttributeCount
}

// DroppedLinks returns the number of links dropped by the span due to limits
// being reached.
func ( snapshot) () int {
	return .droppedLinkCount
}

// DroppedEvents returns the number of events dropped by the span due to
// limits being reached.
func ( snapshot) () int {
	return .droppedEventCount
}

// ChildSpanCount returns the count of spans that consider the span a
// direct parent.
func ( snapshot) () int {
	return .childSpanCount
}