MCPcopy Index your code
hub / github.com/dagger/dagger / NewObjectResultForCall

Function NewObjectResultForCall

dagql/server.go:1987–2011  ·  view source on GitHub ↗
(
	self T,
	srv *Server,
	call *ResultCall,
)

Source from the content-addressed store, hash-verified

1985}
1986
1987func NewObjectResultForCall[T Typed](
1988 self T,
1989 srv *Server,
1990 call *ResultCall,
1991) (res ObjectResult[T], _ error) {
1992 objType, ok := srv.ObjectType(self.Type().Name())
1993 if !ok {
1994 return res, fmt.Errorf("unknown type %q", self.Type().Name())
1995 }
1996 class, ok := objType.(Class[T])
1997 if !ok {
1998 return res, fmt.Errorf("not a Class: %T", objType)
1999 }
2000
2001 inst, err := NewResultForCall(self, call)
2002 if err != nil {
2003 return res, err
2004 }
2005 inst.shared.setObjClass(class)
2006
2007 return ObjectResult[T]{
2008 Result: inst,
2009 class: class,
2010 }, nil
2011}
2012
2013func idToPath(id *call.ID) ast.Path {
2014 path := ast.Path{}

Calls 5

NewResultForCallFunction · 0.85
setObjClassMethod · 0.80
ObjectTypeMethod · 0.65
NameMethod · 0.65
TypeMethod · 0.65